Skip to content

Commit

Permalink
chore: fix bas module interface registry
Browse files Browse the repository at this point in the history
  • Loading branch information
kenta92115 committed Mar 22, 2024
1 parent 02882b1 commit 21701d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ import (

feemarkettypes "swisstronik/x/feemarket/types"

"swisstronik/encoding"
evmmoduletypes "swisstronik/types"

sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/baseapp"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
Expand Down Expand Up @@ -340,3 +343,10 @@ func GenesisStateWithValSet(app *App, genesisState simapp.GenesisState,

return genesisState
}

func MakeConfig() evmmoduletypes.EncodingConfig {
config := encoding.MakeConfig()
ModuleBasics.RegisterLegacyAminoCodec(config.Amino)
ModuleBasics.RegisterInterfaces(config.InterfaceRegistry)
return config
}
6 changes: 2 additions & 4 deletions cmd/swisstronikd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ import (
"path/filepath"
"time"

"swisstronik/encoding"
"swisstronik/ethereum/eip712"

"cosmossdk.io/client/v2/autocli"
"cosmossdk.io/core/appmodule"
confixcmd "cosmossdk.io/tools/confix/cmd"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/types/module"

Expand Down Expand Up @@ -77,7 +75,7 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) {
// Initialize the SDK config the first before doing anything else.
InitSDKConfig()

encodingConfig := encoding.MakeConfig()
encodingConfig := app.MakeConfig()
initClientCtx := client.Context{}.
WithCodec(encodingConfig.Codec).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
Expand Down Expand Up @@ -139,7 +137,7 @@ func NewRootCmd() (*cobra.Command, ethermint.EncodingConfig) {
txConfig := authtx.NewTxConfig(encodingConfig.Codec, authtx.DefaultSignModes)
// gentxModule := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic)

valOperAddressCodec := address.NewBech32Codec(sdktypes.GetConfig().GetBech32ValidatorAddrPrefix())
valOperAddressCodec := encodingConfig.TxConfig.SigningContext().ValidatorAddressCodec()
a := appCreator{encodingConfig}
rootCmd.AddCommand(
evmmoduleclient.ValidateChainID(
Expand Down
1 change: 1 addition & 0 deletions encoding/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ func MakeConfig() ethermint.EncodingConfig {
// This is needed for the EIP712 txs because currently is using
// the deprecated method legacytx.StdSignBytes
legacytx.RegressionTestingAminoCodec = cdc

return encodingConfig
}

0 comments on commit 21701d7

Please sign in to comment.