forked from cerc-io/laconicd-deprecated
feat: import ethermint without forking (#378)
* cmd: cleanup * update gh action * lint * more cleanup * update config * register denom
This commit is contained in:
@@ -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
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user