diff --git a/cmd/swisstronikd/cmd/root.go b/cmd/swisstronikd/cmd/root.go index 50d43cbb..1d5ce8e8 100644 --- a/cmd/swisstronikd/cmd/root.go +++ b/cmd/swisstronikd/cmd/root.go @@ -134,9 +134,6 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { }, } - txConfig := authtx.NewTxConfig(encodingConfig.Codec, authtx.DefaultSignModes) - // gentxModule := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic) - valOperAddressCodec := encodingConfig.TxConfig.SigningContext().ValidatorAddressCodec() a := appCreator{encodingConfig} rootCmd.AddCommand( @@ -147,7 +144,7 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) { genutilcli.MigrateGenesisCmd(genutilcli.MigrationMap), genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, valOperAddressCodec), genutilcli.ValidateGenesisCmd(app.ModuleBasics), - AddGenesisAccountCmd(app.DefaultNodeHome, txConfig.SigningContext().ValidatorAddressCodec()), + AddGenesisAccountCmd(app.DefaultNodeHome, valOperAddressCodec), tmcli.NewCompletionCmd(rootCmd, true), NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}), confixcmd.ConfigCommand(), diff --git a/encoding/config.go b/encoding/config.go index 0726fccf..fa7c9876 100644 --- a/encoding/config.go +++ b/encoding/config.go @@ -17,7 +17,7 @@ package encoding import ( amino "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/address" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/common" @@ -49,13 +49,11 @@ func customGetSignerFn(path string) func(msg proto.Message) ([][]byte, error) { // MakeConfig creates an EncodingConfig for testing func MakeConfig() ethermint.EncodingConfig { cdc := amino.NewLegacyAmino() + addrPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix() + valAddrPrefix := sdk.GetConfig().GetBech32ValidatorAddrPrefix() signingOptions := signing.Options{ - AddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), - }, - ValidatorAddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), - }, + AddressCodec: addresscodec.NewBech32Codec(addrPrefix), + ValidatorAddressCodec: addresscodec.NewBech32Codec(valAddrPrefix), CustomGetSigners: map[protoreflect.FullName]signing.GetSignersFunc{ "ethermint.evm.v1.MsgHandleTx": customGetSignerFn("from"), },