feat: import ethermint without forking (#378)

* cmd: cleanup

* update gh action

* lint

* more cleanup

* update config

* register denom
This commit is contained in:
Federico Kunze Küllmer
2021-07-28 05:47:29 -04:00
committed by GitHub
parent bc2a2eb8f3
commit 09746c6a51
21 changed files with 166 additions and 138 deletions
-23
View File
@@ -42,29 +42,6 @@ func InitConfig(cmd *cobra.Command) error {
return viper.BindPFlag(cli.OutputFlag, cmd.PersistentFlags().Lookup(cli.OutputFlag))
}
// GenerateChainID wraps a cobra command with a RunE function with base 10 integer chain-id random generation
// when a chain-id is not provided.
func GenerateChainID(baseCmd *cobra.Command) *cobra.Command {
// Copy base run command to be used after chain verification
baseRunE := baseCmd.RunE
// Function to replace command's RunE function
generateFn := func(cmd *cobra.Command, args []string) error {
chainID, _ := cmd.Flags().GetString(flags.FlagChainID)
if chainID != "" {
if err := cmd.Flags().Set(flags.FlagChainID, ethermint.GenerateRandomChainID()); err != nil {
return fmt.Errorf("could not set random chain-id: %w", err)
}
}
return baseRunE(cmd, args)
}
baseCmd.RunE = generateFn
return baseCmd
}
// ValidateChainID wraps a cobra command with a RunE function with base 10 integer chain-id verification.
func ValidateChainID(baseCmd *cobra.Command) *cobra.Command {
// Copy base run command to be used after chain verification
+1 -1
View File
@@ -39,8 +39,8 @@ import (
mintypes "github.com/cosmos/cosmos-sdk/x/mint/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/tharsis/ethermint/cmd/ethermintd/config"
"github.com/tharsis/ethermint/crypto/hd"
"github.com/tharsis/ethermint/server/config"
ethermint "github.com/tharsis/ethermint/types"
evmtypes "github.com/tharsis/ethermint/x/evm/types"
)