diff --git a/api/ethermint/evm/v1/access_list_tx.go b/api/ethermint/evm/v1/access_list_tx.go new file mode 100644 index 0000000000..cb391da67f --- /dev/null +++ b/api/ethermint/evm/v1/access_list_tx.go @@ -0,0 +1,62 @@ +package evmv1 + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/ethermint/types" +) + +// GetChainID returns the chain id field from the AccessListTx +func (tx *AccessListTx) GetChainID() *big.Int { + return stringToBigInt(tx.GetChainId()) +} + +// GetAccessList returns the AccessList field. +func (tx *AccessListTx) GetAccessList() ethtypes.AccessList { + if tx.Accesses == nil { + return nil + } + var ethAccessList ethtypes.AccessList + + for _, tuple := range tx.Accesses { + storageKeys := make([]common.Hash, len(tuple.StorageKeys)) + + for i := range tuple.StorageKeys { + storageKeys[i] = common.HexToHash(tuple.StorageKeys[i]) + } + + ethAccessList = append(ethAccessList, ethtypes.AccessTuple{ + Address: common.HexToAddress(tuple.Address), + StorageKeys: storageKeys, + }) + } + + return ethAccessList +} + +// AsEthereumData returns an AccessListTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *AccessListTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.AccessListTx{ + ChainID: tx.GetChainID(), + Nonce: tx.GetNonce(), + GasPrice: stringToBigInt(tx.GetGasPrice()), + Gas: tx.GetGas(), + To: stringToAddress(tx.GetTo()), + Value: stringToBigInt(tx.GetValue()), + Data: tx.GetData(), + AccessList: tx.GetAccessList(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *AccessListTx) GetRawSignatureValues() (v, r, s *big.Int) { + return types.RawSignatureValues(tx.V, tx.R, tx.S) +} diff --git a/api/ethermint/evm/v1/dynamic_fee_tx.go b/api/ethermint/evm/v1/dynamic_fee_tx.go new file mode 100644 index 0000000000..af292bd1b5 --- /dev/null +++ b/api/ethermint/evm/v1/dynamic_fee_tx.go @@ -0,0 +1,66 @@ +// Copyright Tharsis Labs Ltd.(Evmos) +// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE) + +package evmv1 + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/ethermint/types" +) + +// GetChainID returns the chain id field from the DynamicFeeTx +func (tx *DynamicFeeTx) GetChainID() *big.Int { + return stringToBigInt(tx.GetChainId()) +} + +// AsEthereumData returns an DynamicFeeTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *DynamicFeeTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.DynamicFeeTx{ + ChainID: tx.GetChainID(), + Nonce: tx.GetNonce(), + GasTipCap: stringToBigInt(tx.GetGasTipCap()), + GasFeeCap: stringToBigInt(tx.GetGasFeeCap()), + Gas: tx.GetGas(), + To: stringToAddress(tx.GetTo()), + Value: stringToBigInt(tx.GetValue()), + Data: tx.GetData(), + AccessList: tx.GetAccessList(), + V: v, + R: r, + S: s, + } +} + +// GetAccessList returns the AccessList field. +func (tx *DynamicFeeTx) GetAccessList() ethtypes.AccessList { + if tx.Accesses == nil { + return nil + } + var ethAccessList ethtypes.AccessList + + for _, tuple := range tx.Accesses { + storageKeys := make([]common.Hash, len(tuple.StorageKeys)) + + for i := range tuple.StorageKeys { + storageKeys[i] = common.HexToHash(tuple.StorageKeys[i]) + } + + ethAccessList = append(ethAccessList, ethtypes.AccessTuple{ + Address: common.HexToAddress(tuple.Address), + StorageKeys: storageKeys, + }) + } + + return ethAccessList +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *DynamicFeeTx) GetRawSignatureValues() (v, r, s *big.Int) { + return types.RawSignatureValues(tx.V, tx.R, tx.S) +} diff --git a/api/ethermint/evm/v1/legacy_tx.go b/api/ethermint/evm/v1/legacy_tx.go new file mode 100644 index 0000000000..a9ed58e12d --- /dev/null +++ b/api/ethermint/evm/v1/legacy_tx.go @@ -0,0 +1,42 @@ +package evmv1 + +import ( + "math/big" + + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/evmos/ethermint/types" +) + +// GetChainID returns the chain id field from the derived signature values +func (tx *LegacyTx) GetChainID() *big.Int { + v, _, _ := tx.GetRawSignatureValues() + return types.DeriveChainID(v) +} + +// AsEthereumData returns an LegacyTx transaction tx from the proto-formatted +// TxData defined on the Cosmos EVM. +func (tx *LegacyTx) AsEthereumData() ethtypes.TxData { + v, r, s := tx.GetRawSignatureValues() + return ðtypes.LegacyTx{ + Nonce: tx.GetNonce(), + GasPrice: stringToBigInt(tx.GetGasPrice()), + Gas: tx.GetGas(), + To: stringToAddress(tx.GetTo()), + Value: stringToBigInt(tx.GetValue()), + Data: tx.GetData(), + V: v, + R: r, + S: s, + } +} + +// GetRawSignatureValues returns the V, R, S signature values of the transaction. +// The return values should not be modified by the caller. +func (tx *LegacyTx) GetRawSignatureValues() (v, r, s *big.Int) { + return types.RawSignatureValues(tx.V, tx.R, tx.S) +} + +// GetAccessList returns nil +func (tx *LegacyTx) GetAccessList() ethtypes.AccessList { + return nil +} diff --git a/api/ethermint/evm/v1/msg.go b/api/ethermint/evm/v1/msg.go new file mode 100644 index 0000000000..f2d29d2f88 --- /dev/null +++ b/api/ethermint/evm/v1/msg.go @@ -0,0 +1,56 @@ +package evmv1 + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + protov2 "google.golang.org/protobuf/proto" +) + +// supportedTxs holds the Ethereum transaction types +// supported by Evmos. +// Use a function to return a new pointer and avoid +// possible reuse or racing conditions when using the same pointer +var supportedTxs = map[string]func() TxDataV2{ + "/ethermint.evm.v1.DynamicFeeTx": func() TxDataV2 { return &DynamicFeeTx{} }, + "/ethermint.evm.v1.AccessListTx": func() TxDataV2 { return &AccessListTx{} }, + "/ethermint.evm.v1.LegacyTx": func() TxDataV2 { return &LegacyTx{} }, +} + +// getSender extracts the sender address from the signature values using the latest signer for the given chainID. +func getSender(txData TxDataV2) (common.Address, error) { + signer := ethtypes.LatestSignerForChainID(txData.GetChainID()) + from, err := signer.Sender(ethtypes.NewTx(txData.AsEthereumData())) + if err != nil { + return common.Address{}, err + } + return from, nil +} + +// GetSigners is the custom function to get signers on Ethereum transactions +// Gets the signer's address from the Ethereum tx signature +func GetSigners(msg protov2.Message) ([][]byte, error) { + msgEthTx, ok := msg.(*MsgEthereumTx) + if !ok { + return nil, fmt.Errorf("invalid type, expected MsgEthereumTx and got %T", msg) + } + + txDataFn, found := supportedTxs[msgEthTx.Data.TypeUrl] + if !found { + return nil, fmt.Errorf("invalid TypeUrl %s", msgEthTx.Data.TypeUrl) + } + txData := txDataFn() + + // msgEthTx.Data is a message (DynamicFeeTx, LegacyTx or AccessListTx) + if err := msgEthTx.Data.UnmarshalTo(txData); err != nil { + return nil, err + } + + sender, err := getSender(txData) + if err != nil { + return nil, err + } + + return [][]byte{sender.Bytes()}, nil +} diff --git a/api/ethermint/evm/v1/tx_data.go b/api/ethermint/evm/v1/tx_data.go new file mode 100644 index 0000000000..aa43df6814 --- /dev/null +++ b/api/ethermint/evm/v1/tx_data.go @@ -0,0 +1,45 @@ +package evmv1 + +import ( + "math/big" + + sdkmath "cosmossdk.io/math" + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "google.golang.org/protobuf/reflect/protoreflect" +) + +var ( + _ TxDataV2 = &LegacyTx{} + _ TxDataV2 = &AccessListTx{} + _ TxDataV2 = &DynamicFeeTx{} +) + +// TxDataV2 implements the Ethereum transaction tx structure. It is used +// solely to define the custom logic for getting signers on Ethereum transactions. +type TxDataV2 interface { + GetChainID() *big.Int + AsEthereumData() ethtypes.TxData + + ProtoReflect() protoreflect.Message +} + +// helper function to parse string to bigInt +func stringToBigInt(str string) *big.Int { + if str == "" { + return nil + } + res, ok := sdkmath.NewIntFromString(str) + if !ok { + return nil + } + return res.BigInt() +} + +func stringToAddress(toStr string) *common.Address { + if toStr == "" { + return nil + } + addr := common.HexToAddress(toStr) + return &addr +} diff --git a/app/ante/fee_checker_test.go b/app/ante/fee_checker_test.go index 94c254f5f0..feb7a2f8ac 100644 --- a/app/ante/fee_checker_test.go +++ b/app/ante/fee_checker_test.go @@ -12,7 +12,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/params" @@ -55,7 +54,7 @@ func TestSDKTxFeeChecker(t *testing.T) { // with extension option // without extension option // london hardfork enableness - encodingConfig := encoding.MakeConfig(module.NewBasicManager()) + encodingConfig := encoding.MakeConfig() minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("aphoton", math.NewInt(10))) genesisCtx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/app/ante/utils_test.go b/app/ante/utils_test.go index ff2db48136..1690de00f0 100644 --- a/app/ante/utils_test.go +++ b/app/ante/utils_test.go @@ -49,7 +49,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/evmos/ethermint/app" "github.com/evmos/ethermint/app/ante" - "github.com/evmos/ethermint/encoding" "github.com/evmos/ethermint/tests" ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/statedb" @@ -128,12 +127,10 @@ func (suite *AnteTestSuite) SetupTest() { acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) // We're using TestMsg amino encoding in some tests, so register it here. - encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - eip712.SetEncodingConfig(encodingConfig) + suite.app.LegacyAmino().RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) + suite.clientCtx = client.Context{}.WithTxConfig(suite.app.TxConfig()) anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{ AccountKeeper: suite.app.AccountKeeper, @@ -142,7 +139,7 @@ func (suite *AnteTestSuite) SetupTest() { FeegrantKeeper: suite.app.FeeGrantKeeper, IBCKeeper: suite.app.IBCKeeper, FeeMarketKeeper: suite.app.FeeMarketKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + SignModeHandler: suite.app.TxConfig().SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, DisabledAuthzMsgs: []string{ sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}), diff --git a/app/app.go b/app/app.go index c9479fae2d..135ec4e227 100644 --- a/app/app.go +++ b/app/app.go @@ -31,7 +31,6 @@ import ( "cosmossdk.io/log" "cosmossdk.io/simapp" - simappparams "cosmossdk.io/simapp/params" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/evidence" evidencekeeper "cosmossdk.io/x/evidence/keeper" @@ -39,7 +38,6 @@ import ( "cosmossdk.io/x/feegrant" feegrantkeeper "cosmossdk.io/x/feegrant/keeper" feegrantmodule "cosmossdk.io/x/feegrant/module" - "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" upgradetypes "cosmossdk.io/x/upgrade/types" @@ -56,9 +54,9 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/std" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" @@ -66,6 +64,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/posthandler" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -106,7 +105,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gogoproto/proto" "github.com/cosmos/ibc-go/modules/capability" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" @@ -121,9 +119,9 @@ import ( // unnamed import of statik for swagger UI support _ "github.com/evmos/ethermint/client/docs/statik" + "github.com/evmos/ethermint/encoding" "github.com/evmos/ethermint/app/ante" - "github.com/evmos/ethermint/ethereum/eip712" srvflags "github.com/evmos/ethermint/server/flags" ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm" @@ -272,49 +270,26 @@ func NewEthermintApp( appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *EthermintApp { - legacyAmino := codec.NewLegacyAmino() - interfaceRegistry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ - ProtoFiles: proto.HybridResolver, - SigningOptions: signing.Options{ - AddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), - }, - ValidatorAddressCodec: address.Bech32Codec{ - Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), - }, - }, - }) - if err != nil { - panic(err) - } - appCodec := codec.NewProtoCodec(interfaceRegistry) - txConfig := authtx.NewTxConfig(appCodec, authtx.DefaultSignModes) - - std.RegisterLegacyAminoCodec(legacyAmino) - std.RegisterInterfaces(interfaceRegistry) + encodingConfig := encoding.MakeConfig() + appCodec := encodingConfig.Codec + legacyAmino := encodingConfig.Amino + interfaceRegistry := encodingConfig.InterfaceRegistry skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) - eip712.SetEncodingConfig(simappparams.EncodingConfig{ - InterfaceRegistry: interfaceRegistry, - Codec: appCodec, - TxConfig: txConfig, - Amino: legacyAmino, - - }) // NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx bApp := baseapp.NewBaseApp( appName, logger, db, - txConfig.TxDecoder(), + encodingConfig.TxConfig.TxDecoder(), baseAppOptions..., ) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) - bApp.SetTxEncoder(txConfig.TxEncoder()) + bApp.SetTxEncoder(encodingConfig.TxConfig.TxEncoder()) keys := storetypes.NewKVStoreKeys( // SDK keys @@ -345,7 +320,7 @@ func NewEthermintApp( appCodec: appCodec, interfaceRegistry: interfaceRegistry, invCheckPeriod: invCheckPeriod, - txConfig: txConfig, + txConfig: encodingConfig.TxConfig, keys: keys, tkeys: tkeys, memKeys: memKeys, @@ -390,6 +365,22 @@ func NewEthermintApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), logger, ) + + // optional: enable sign mode textual by overwriting the default tx config (after setting the bank keeper) + enabledSignModes := append(authtx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) //nolint:gocritic + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err := authtx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, + ) + if err != nil { + panic(err) + } + app.txConfig = txConfig + app.StakingKeeper = stakingkeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), @@ -572,7 +563,7 @@ func NewEthermintApp( app.AccountKeeper, app.StakingKeeper, app, - txConfig, + encodingConfig.TxConfig, ), auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), @@ -719,7 +710,7 @@ func NewEthermintApp( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) app.SetEndBlocker(app.EndBlocker) - app.setAnteHandler(txConfig, cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted))) + app.setAnteHandler(encodingConfig.TxConfig, cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted))) // In v0.46, the SDK introduces _postHandlers_. PostHandlers are like // antehandlers, but are run _after_ the `runMsgs` execution. They are also // defined as a chain, and have the same signature as antehandlers. @@ -897,6 +888,7 @@ func (app *EthermintApp) GetSubspace(moduleName string) paramstypes.Subspace { // API server. func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx + // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. @@ -904,8 +896,8 @@ func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config. // Register node gRPC service for grpc-gateway. node.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register legacy and grpc-gateway routes for all modules. + app.BasicModuleManager.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // register swagger API from root so that other applications can override easily if apiConfig.Swagger { @@ -934,6 +926,11 @@ func (app *EthermintApp) RegisterNodeService(clientCtx client.Context, cfg confi node.RegisterNodeService(clientCtx, app.GRPCQueryRouter(),cfg) } +// DefaultGenesis returns a default genesis from the registered AppModuleBasic's. +func (app *EthermintApp) DefaultGenesis() simapp.GenesisState { + return app.BasicModuleManager.DefaultGenesis(app.appCodec) +} + // RegisterSwaggerAPI registers swagger route with API Server func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) { statikFS, err := fs.New() diff --git a/app/benchmark_test.go b/app/benchmark_test.go index 399ba6be7f..a674edcbc9 100644 --- a/app/benchmark_test.go +++ b/app/benchmark_test.go @@ -15,7 +15,7 @@ func BenchmarkEthermintApp_ExportAppStateAndValidators(b *testing.B) { db := dbm.NewMemDB() app := NewEthermintApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, simtestutil.EmptyAppOptions{}) - genesisState := NewTestGenesisState(app.AppCodec()) + genesisState := NewTestGenesisState(app) stateBytes, err := json.MarshalIndent(genesisState, "", " ") if err != nil { b.Fatal(err) diff --git a/app/export.go b/app/export.go index f019c267fa..e1e1924947 100644 --- a/app/export.go +++ b/app/export.go @@ -33,7 +33,7 @@ import ( // NewDefaultGenesisState generates the default state for the application. func NewDefaultGenesisState() simapp.GenesisState { - encCfg := encoding.MakeConfig(ModuleBasics) + encCfg := encoding.MakeConfig() return ModuleBasics.DefaultGenesis(encCfg.Codec) } diff --git a/app/utils.go b/app/utils.go index 939e149ecc..e645d07933 100644 --- a/app/utils.go +++ b/app/utils.go @@ -61,12 +61,25 @@ var DefaultConsensusParams = &types1.ConsensusParams{ } // Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp. -func Setup(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState) *EthermintApp { - return SetupWithDB(isCheckTx, patchGenesis, dbm.NewMemDB()) +func Setup( + isCheckTx bool, + patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState, + baseAppOptions ...func(*baseapp.BaseApp), +) *EthermintApp { + return SetupWithDB(isCheckTx, patchGenesis, dbm.NewMemDB(), baseAppOptions...) } // SetupWithDB initializes a new EthermintApp. A Nop logger is set in EthermintApp. -func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *EthermintApp { +func SetupWithDB( + isCheckTx bool, + patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState, + db dbm.DB, + baseAppOptions ...func(*baseapp.BaseApp), +) *EthermintApp { + if baseAppOptions == nil { + baseAppOptions = []func(*baseapp.BaseApp){} + } + baseAppOptions = append(baseAppOptions, baseapp.SetChainID("ethermint_9000-1")) // setup chain id app := NewEthermintApp(log.NewNopLogger(), db, @@ -75,11 +88,12 @@ func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.Genesis map[int64]bool{}, DefaultNodeHome, simtestutil.EmptyAppOptions{}, - // NOTE: added as init examines the chain id - baseapp.SetChainID("ethermint_9000-1")) + baseAppOptions..., + // NOTE: added as init examines the chain id + ) if !isCheckTx { // init chain must be called to stop deliverState from being nil - genesisState := NewTestGenesisState(app.AppCodec()) + genesisState := NewTestGenesisState(app) if patchGenesis != nil { genesisState = patchGenesis(app, genesisState) } @@ -90,21 +104,23 @@ func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.Genesis } // Initialize the chain - app.InitChain( + if _, err := app.InitChain( &abci.RequestInitChain{ ChainId: "ethermint_9000-1", Validators: []abci.ValidatorUpdate{}, ConsensusParams: DefaultConsensusParams, AppStateBytes: stateBytes, }, - ) + ); err != nil { + panic(err) + } } return app } // NewTestGenesisState generate genesis state with single validator -func NewTestGenesisState(codec codec.Codec) simapp.GenesisState { +func NewTestGenesisState(app *EthermintApp) simapp.GenesisState { privVal := mock.NewPV() pubKey, err := privVal.GetPubKey() if err != nil { @@ -122,8 +138,8 @@ func NewTestGenesisState(codec codec.Codec) simapp.GenesisState { Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), } - genesisState := NewDefaultGenesisState() - return genesisStateWithValSet(codec, genesisState, valSet, []authtypes.GenesisAccount{acc}, balance) + genesisState := app.DefaultGenesis() + return genesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balance) } func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, @@ -162,7 +178,7 @@ func genesisStateWithValSet(codec codec.Codec, genesisState simapp.GenesisState, MinSelfDelegation: math.ZeroInt(), } validators = append(validators, validator) - delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), val.Address.String(), math.LegacyOneDec())) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), validator.OperatorAddress, math.LegacyOneDec())) } // set validators and delegations stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) diff --git a/encoding/config.go b/encoding/config.go index 779ceab71d..bf02137b06 100644 --- a/encoding/config.go +++ b/encoding/config.go @@ -16,31 +16,67 @@ package encoding import ( - "cosmossdk.io/simapp/params" + "cosmossdk.io/x/tx/signing" amino "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/address" "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/x/auth/tx" + "github.com/cosmos/gogoproto/proto" + "google.golang.org/protobuf/reflect/protoreflect" enccodec "github.com/evmos/ethermint/encoding/codec" + "github.com/evmos/ethermint/ethereum/eip712" + evmtypes "github.com/evmos/ethermint/x/evm/types" ) -// MakeConfig creates an EncodingConfig for testing -func MakeConfig(mb module.BasicManager) params.EncodingConfig { +// MakeConfig returns a TestEncodingConfig for testing that is properly configured +// for legacy amino and the evm module. +// +// This is used for testing the EIP712 txs because currently is using +// the deprecated method legacytx.StdSignBytes. +func MakeConfig() sdktestutil.TestEncodingConfig { cdc := amino.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() + signingOptions := signing.Options{ + AddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), + }, + ValidatorAddressCodec: address.Bech32Codec{ + Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), + }, + CustomGetSigners: map[protoreflect.FullName]signing.GetSignersFunc{ + evmtypes.MsgEthereumTxCustomGetSigner.MsgType: evmtypes.MsgEthereumTxCustomGetSigner.Fn, + }, + } + + interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ + ProtoFiles: proto.HybridResolver, + SigningOptions: signingOptions, + }) codec := amino.NewProtoCodec(interfaceRegistry) + enccodec.RegisterLegacyAminoCodec(cdc) + enccodec.RegisterInterfaces(interfaceRegistry) - encodingConfig := params.EncodingConfig{ + // This is needed for the EIP712 txs because currently is using + // the deprecated method legacytx.StdSignBytes + legacytx.RegressionTestingAminoCodec = cdc + eip712.SetEncodingConfig(cdc, interfaceRegistry) + + return sdktestutil.TestEncodingConfig{ InterfaceRegistry: interfaceRegistry, Codec: codec, TxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes), Amino: cdc, } +} - enccodec.RegisterLegacyAminoCodec(encodingConfig.Amino) - mb.RegisterLegacyAminoCodec(encodingConfig.Amino) - enccodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) - mb.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig +// MakeTestConfig creates an EncodingConfig for testing +func MakeTestConfig(mb module.BasicManager) sdktestutil.TestEncodingConfig { + config := MakeConfig() + mb.RegisterLegacyAminoCodec(config.Amino) + mb.RegisterInterfaces(config.InterfaceRegistry) + return config } diff --git a/encoding/config_test.go b/encoding/config_test.go index 1e9dd6fb5d..54821977f4 100644 --- a/encoding/config_test.go +++ b/encoding/config_test.go @@ -8,7 +8,6 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/evmos/ethermint/app" "github.com/evmos/ethermint/encoding" utiltx "github.com/evmos/ethermint/testutil/tx" evmtypes "github.com/evmos/ethermint/x/evm/types" @@ -25,7 +24,7 @@ func TestTxEncoding(t *testing.T) { err := msg.Sign(ethSigner, signer) require.NoError(t, err) - cfg := encoding.MakeConfig(app.ModuleBasics) + cfg := encoding.MakeConfig() _, err = cfg.TxConfig.TxEncoder()(msg) require.Error(t, err, "encoding failed") diff --git a/ethereum/eip712/eip712_test.go b/ethereum/eip712/eip712_test.go index cec485833c..cf86c2ed4b 100644 --- a/ethereum/eip712/eip712_test.go +++ b/ethereum/eip712/eip712_test.go @@ -7,23 +7,23 @@ import ( "cosmossdk.io/math" - chainparams "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/client" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/evmos/ethermint/app" "github.com/evmos/ethermint/ethereum/eip712" "github.com/tidwall/gjson" "github.com/tidwall/sjson" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/evmos/ethermint/crypto/ethsecp256k1" txtypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/evmos/ethermint/app" "github.com/evmos/ethermint/cmd/config" "github.com/evmos/ethermint/encoding" "github.com/evmos/ethermint/testutil" @@ -46,7 +46,7 @@ const ( type EIP712TestSuite struct { suite.Suite - config chainparams.EncodingConfig + config sdktestutil.TestEncodingConfig clientCtx client.Context useLegacyEIP712TypedData bool denom string @@ -70,12 +70,12 @@ func TestEIP712TestSuite(t *testing.T) { } func (suite *EIP712TestSuite) SetupTest() { - suite.config = encoding.MakeConfig(app.ModuleBasics) + suite.config = encoding.MakeTestConfig(app.ModuleBasics) suite.clientCtx = client.Context{}.WithTxConfig(suite.config.TxConfig) suite.denom = evmtypes.DefaultEVMDenom sdk.GetConfig().SetBech32PrefixForAccount(config.Bech32Prefix, "") - eip712.SetEncodingConfig(suite.config) + eip712.SetEncodingConfig(suite.config.Amino, suite.config.InterfaceRegistry) } // createTestAddress creates random test addresses for messages diff --git a/ethereum/eip712/encoding.go b/ethereum/eip712/encoding.go index e16b8085ce..d755c89761 100644 --- a/ethereum/eip712/encoding.go +++ b/ethereum/eip712/encoding.go @@ -19,9 +19,9 @@ import ( "errors" "fmt" - "cosmossdk.io/simapp/params" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" txTypes "github.com/cosmos/cosmos-sdk/types/tx" @@ -40,9 +40,9 @@ var ( // The process of unmarshaling SignDoc bytes into a SignDoc object requires having a codec // populated with all relevant message types. As a result, we must call this method on app // initialization with the app's encoding config. -func SetEncodingConfig(cfg params.EncodingConfig) { - aminoCodec = cfg.Amino - protoCodec = codec.NewProtoCodec(cfg.InterfaceRegistry) +func SetEncodingConfig(cdc *codec.LegacyAmino, interfaceRegistry codectypes.InterfaceRegistry) { + aminoCodec = cdc + protoCodec = codec.NewProtoCodec(interfaceRegistry) } // GetEIP712BytesForMsg returns the EIP-712 object bytes for the given SignDoc bytes by decoding the bytes into diff --git a/go.mod b/go.mod index bba3d631f3..6dc52c1e6e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/evmos/ethermint -go 1.21 +go 1.22 + +toolchain go1.22.2 require ( github.com/cosmos/cosmos-sdk v0.50.10 @@ -13,18 +15,19 @@ require ( cosmossdk.io/core v0.11.1 cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20240118210941-3897926e722e cosmossdk.io/store v1.1.1 - cosmossdk.io/tools/rosetta v0.2.1 + cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 - github.com/armon/go-metrics v0.4.1 github.com/btcsuite/btcd v0.24.2 github.com/btcsuite/btcd/btcutil v1.1.6 github.com/cometbft/cometbft v0.38.12 - github.com/cometbft/cometbft-db v0.11.0 + github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.7.0 @@ -35,10 +38,11 @@ require ( github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/hashicorp/go-metrics v0.5.3 github.com/holiman/uint256 v1.2.2 github.com/improbable-eng/grpc-web v0.15.0 - github.com/onsi/ginkgo/v2 v2.9.2 - github.com/onsi/gomega v1.27.6 + github.com/onsi/ginkgo/v2 v2.20.1 + github.com/onsi/gomega v1.35.1 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/rs/cors v1.11.1 @@ -50,11 +54,12 @@ require ( github.com/tidwall/gjson v1.14.4 github.com/tidwall/sjson v1.2.5 github.com/tyler-smith/go-bip39 v1.1.0 - golang.org/x/net v0.28.0 - golang.org/x/text v0.17.0 + golang.org/x/net v0.30.0 + golang.org/x/sync v0.8.0 + golang.org/x/text v0.19.0 google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d google.golang.org/grpc v1.64.1 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.35.1 sigs.k8s.io/yaml v1.4.0 ) @@ -67,10 +72,8 @@ require ( cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/client/v2 v2.0.0-beta.3 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/x/circuit v0.1.1 // indirect cosmossdk.io/x/nft v0.1.0 // indirect - cosmossdk.io/x/tx v0.13.5 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -97,8 +100,8 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect + github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.0 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect @@ -125,12 +128,13 @@ require ( github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-stack/stack v1.8.1 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/golang/glog v1.2.0 // indirect @@ -140,7 +144,7 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect + github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -152,7 +156,6 @@ require ( github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect @@ -185,9 +188,11 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/nxadm/tail v1.4.8 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -227,19 +232,19 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/go.sum b/go.sum index 0812cc481b..ff3604b64d 100644 --- a/go.sum +++ b/go.sum @@ -210,8 +210,8 @@ cosmossdk.io/simapp v0.0.0-20240118210941-3897926e722e h1:prrEM8wTWf6Rv0XchutuUt cosmossdk.io/simapp v0.0.0-20240118210941-3897926e722e/go.mod h1:MoWto/xnPVt23TgkMEp5Rssw9Z7sV7VUQb8j5/y+fXY= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f h1:p/pez1Q7Xwh9AiHWMA0uHxsB+XpReABHr6xCyMWdDAg= +cosmossdk.io/tools/rosetta v0.2.1-0.20230613133644-0a778132a60f/go.mod h1:kzkqn95F9UonJTmjS+aydreXxsWiaGKe/b4HxHZvwHM= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= @@ -281,8 +281,6 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= @@ -599,8 +597,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -622,9 +620,10 @@ github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -746,8 +745,8 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= -github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -1074,16 +1073,16 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= -github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= +github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= +github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= -github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= +github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1410,8 +1409,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1426,8 +1425,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= -golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1456,8 +1455,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1526,8 +1525,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1684,8 +1683,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1693,8 +1692,8 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1709,8 +1708,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1786,8 +1785,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2037,8 +2036,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/indexer/kv_indexer_test.go b/indexer/kv_indexer_test.go index b88bc4baae..390100b7d6 100644 --- a/indexer/kv_indexer_test.go +++ b/indexer/kv_indexer_test.go @@ -5,7 +5,6 @@ import ( "testing" tmlog "cosmossdk.io/log" - "cosmossdk.io/simapp/params" abci "github.com/cometbft/cometbft/abci/types" tmtypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" @@ -36,7 +35,7 @@ func TestKVIndexer(t *testing.T) { require.NoError(t, tx.Sign(ethSigner, signer)) txHash := tx.AsTransaction().Hash() - encodingConfig := MakeEncodingConfig() + encodingConfig := evmenc.MakeTestConfig(app.ModuleBasics) clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig).WithCodec(encodingConfig.Codec) // build cosmos-sdk wrapper tx @@ -182,8 +181,3 @@ func TestKVIndexer(t *testing.T) { }) } } - -// MakeEncodingConfig creates the EncodingConfig -func MakeEncodingConfig() params.EncodingConfig { - return evmenc.MakeConfig(app.ModuleBasics) -} diff --git a/rpc/backend/backend_suite_test.go b/rpc/backend/backend_suite_test.go index 704c0ba37a..a623d4ef5d 100644 --- a/rpc/backend/backend_suite_test.go +++ b/rpc/backend/backend_suite_test.go @@ -68,7 +68,7 @@ func (suite *BackendTestSuite) SetupTest() { suite.signer = utiltx.NewSigner(priv) suite.Require().NoError(err) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeTestConfig(app.ModuleBasics) clientCtx := client.Context{}.WithChainID(ChainID). WithHeight(1). WithTxConfig(encodingConfig.TxConfig). @@ -86,7 +86,7 @@ func (suite *BackendTestSuite) SetupTest() { suite.backend.ctx = rpctypes.ContextWithHeight(1) // Add codec - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) suite.backend.clientCtx.Codec = encCfg.Codec } @@ -166,7 +166,7 @@ func (suite *BackendTestSuite) buildFormattedBlock( func (suite *BackendTestSuite) generateTestKeyring(clientDir string) (keyring.Keyring, error) { buf := bufio.NewReader(os.Stdin) - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) return keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, clientDir, buf, encCfg.Codec, []keyring.Option{hd.EthSecp256k1Option()}...) } diff --git a/testutil/network/network.go b/testutil/network/network.go index 8c20e95074..e6e1b219f2 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -46,7 +46,6 @@ import ( "google.golang.org/grpc" "cosmossdk.io/simapp" - "cosmossdk.io/simapp/params" pruningtypes "cosmossdk.io/store/pruning/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -62,6 +61,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" @@ -87,7 +87,7 @@ var ( type AppConstructor = func(val Validator) servertypes.Application // NewAppConstructor returns a new simapp AppConstructor -func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor { +func NewAppConstructor(encodingCfg sdktestutil.TestEncodingConfig) AppConstructor { return func(val Validator) servertypes.Application { return app.NewEthermintApp( val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), @@ -132,7 +132,7 @@ type Config struct { // DefaultConfig returns a sane default configuration suitable for nearly all // testing requirements. func DefaultConfig() Config { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) return Config{ Codec: encCfg.Codec, diff --git a/types/account.go b/types/account.go index 65d381b5ab..e1e99df735 100644 --- a/types/account.go +++ b/types/account.go @@ -27,7 +27,7 @@ import ( ) var ( - _ authtypes.AccountI = (*EthAccount)(nil) + _ sdk.AccountI = (*EthAccount)(nil) _ EthAccountI = (*EthAccount)(nil) _ authtypes.GenesisAccount = (*EthAccount)(nil) _ codectypes.UnpackInterfacesMessage = (*EthAccount)(nil) diff --git a/types/block.go b/types/block.go index 5d0db44b9e..3b5a84c275 100644 --- a/types/block.go +++ b/types/block.go @@ -15,7 +15,11 @@ // along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + math "math" + + sdk "github.com/cosmos/cosmos-sdk/types" +) // BlockGasLimit returns the max gas (limit) defined in the block gas meter. If the meter is not // set, it returns the max gas from the application consensus params. @@ -35,8 +39,15 @@ func BlockGasLimit(ctx sdk.Context) uint64 { } maxGas := cp.Block.MaxGas + + // Setting max_gas to -1 in Tendermint means there is no limit on the maximum gas consumption for transactions + // https://github.com/cometbft/cometbft/blob/v0.37.2/proto/tendermint/types/params.proto#L25-L27 + if maxGas == -1 { + return math.MaxUint64 + } + if maxGas > 0 { - return uint64(maxGas) + return uint64(maxGas) // #nosec G701 -- maxGas is int64 type. It can never be greater than math.MaxUint64 } return 0 diff --git a/types/codec.go b/types/codec.go index 1bf2e00dbd..e85182cd35 100644 --- a/types/codec.go +++ b/types/codec.go @@ -17,6 +17,7 @@ package types import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -25,7 +26,7 @@ import ( // implementations and interfaces. func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( - (*authtypes.AccountI)(nil), + (*sdk.AccountI)(nil), &EthAccount{}, ) registry.RegisterImplementations( diff --git a/types/eth.go b/types/eth.go new file mode 100644 index 0000000000..1319050f4e --- /dev/null +++ b/types/eth.go @@ -0,0 +1,48 @@ +package types + +import "math/big" + +// DeriveChainID derives the chain id from the given v parameter. +// +// CONTRACT: v value is either: +// +// - {0,1} + CHAIN_ID * 2 + 35, if EIP155 is used +// - {0,1} + 27, otherwise +// +// Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md +func DeriveChainID(v *big.Int) *big.Int { + if v == nil || v.Sign() < 1 { + return nil + } + + if v.BitLen() <= 64 { + v := v.Uint64() + if v == 27 || v == 28 { + return new(big.Int) + } + + if v < 35 { + return nil + } + + // V MUST be of the form {0,1} + CHAIN_ID * 2 + 35 + return new(big.Int).SetUint64((v - 35) / 2) + } + v = new(big.Int).Sub(v, big.NewInt(35)) + return v.Div(v, big.NewInt(2)) +} + +// RawSignatureValues is a helper function +// that parses the v,r and s fields of an Ethereum transaction +func RawSignatureValues(vBz, rBz, sBz []byte) (v, r, s *big.Int) { + if len(vBz) > 0 { + v = new(big.Int).SetBytes(vBz) + } + if len(rBz) > 0 { + r = new(big.Int).SetBytes(rBz) + } + if len(sBz) > 0 { + s = new(big.Int).SetBytes(sBz) + } + return v, r, s +} \ No newline at end of file diff --git a/x/evm/handler_test.go b/x/evm/handler_test.go index 04c3ae04ea..e8f8f3cf5d 100644 --- a/x/evm/handler_test.go +++ b/x/evm/handler_test.go @@ -10,9 +10,6 @@ import ( sdkmath "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" - "cosmossdk.io/simapp" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -85,42 +82,28 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) { feemarketGenesis.Params.NoBaseFee = false genesis[feemarkettypes.ModuleName] = app.AppCodec().MustMarshalJSON(feemarketGenesis) } + + coins := sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdkmath.NewInt(100000000000000))) + b32address := sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), priv.PubKey().Address().Bytes()) + balances := []banktypes.Balance{ + { + Address: b32address, + Coins: coins, + }, + { + Address: app.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName).String(), + Coins: coins, + }, + } + var bankGenesis banktypes.GenesisState + app.AppCodec().MustUnmarshalJSON(genesis[banktypes.ModuleName], &bankGenesis) + // Update balances and total supply + bankGenesis.Balances = append(bankGenesis.Balances, balances...) + bankGenesis.Supply = bankGenesis.Supply.Add(coins...).Add(coins...) + genesis[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(&bankGenesis) return genesis }) - coins := sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdkmath.NewInt(100000000000000))) - genesisState := app.NewTestGenesisState(suite.app.AppCodec()) - b32address := sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), priv.PubKey().Address().Bytes()) - balances := []banktypes.Balance{ - { - Address: b32address, - Coins: coins, - }, - { - Address: suite.app.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName).String(), - Coins: coins, - }, - } - var bankGenesis banktypes.GenesisState - suite.app.AppCodec().MustUnmarshalJSON(genesisState[banktypes.ModuleName], &bankGenesis) - // Update balances and total supply - bankGenesis.Balances = append(bankGenesis.Balances, balances...) - bankGenesis.Supply = bankGenesis.Supply.Add(coins...).Add(coins...) - genesisState[banktypes.ModuleName] = suite.app.AppCodec().MustMarshalJSON(&bankGenesis) - - stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ") - require.NoError(t, err) - - // Initialize the chain - suite.app.InitChain( - &abci.RequestInitChain{ - ChainId: "ethermint_9000-1", - Validators: []abci.ValidatorUpdate{}, - ConsensusParams: app.DefaultConsensusParams, - AppStateBytes: stateBytes, - }, - ) - suite.ctx = suite.app.BaseApp.NewContextLegacy(checkTx, tmproto.Header{ Height: 1, ChainID: "ethermint_9000-1", @@ -148,8 +131,11 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) { queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper) + accountNumber, err := suite.app.AccountKeeper.AccountNumber.Next(suite.ctx) + require.NoError(t, err) + acc := ðermint.EthAccount{ - BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(address.Bytes()), nil, 0, 0), + BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(address.Bytes()), nil, accountNumber, 0), CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(), } diff --git a/x/evm/migrations/v2/migrate_test.go b/x/evm/migrations/v2/migrate_test.go index 78750189d7..429cde512d 100644 --- a/x/evm/migrations/v2/migrate_test.go +++ b/x/evm/migrations/v2/migrate_test.go @@ -19,7 +19,7 @@ import ( ) func TestMigrateStore(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) feemarketKey := storetypes.NewKVStoreKey(types.StoreKey) tFeeMarketKey := storetypes.NewTransientStoreKey(fmt.Sprintf("%s_test", types.StoreKey)) ctx := testutil.DefaultContext(feemarketKey, tFeeMarketKey) diff --git a/x/evm/migrations/v3/migrate_test.go b/x/evm/migrations/v3/migrate_test.go index 6357c3a9e0..838527256e 100644 --- a/x/evm/migrations/v3/migrate_test.go +++ b/x/evm/migrations/v3/migrate_test.go @@ -20,7 +20,7 @@ import ( ) func TestMigrateStore(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) evmKey := storetypes.NewKVStoreKey(types.StoreKey) tEvmKey := storetypes.NewTransientStoreKey(fmt.Sprintf("%s_test", types.StoreKey)) ctx := testutil.DefaultContext(evmKey, tEvmKey) diff --git a/x/evm/migrations/v4/migrate_test.go b/x/evm/migrations/v4/migrate_test.go index cdb6bd6136..2bd785fa61 100644 --- a/x/evm/migrations/v4/migrate_test.go +++ b/x/evm/migrations/v4/migrate_test.go @@ -29,7 +29,7 @@ func (ms mockSubspace) GetParamSetIfExists(ctx sdk.Context, ps types.LegacyParam } func TestMigrate(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) cdc := encCfg.Codec storeKey := storetypes.NewKVStoreKey(types.ModuleName) diff --git a/x/evm/migrations/v5/migrate_test.go b/x/evm/migrations/v5/migrate_test.go index 740d779774..1763b16b75 100644 --- a/x/evm/migrations/v5/migrate_test.go +++ b/x/evm/migrations/v5/migrate_test.go @@ -15,7 +15,7 @@ import ( ) func TestMigrate(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) cdc := encCfg.Codec storeKey := storetypes.NewKVStoreKey(types.ModuleName) diff --git a/x/evm/types/msg.go b/x/evm/types/msg.go index 6446ff58c1..80b3dfd724 100644 --- a/x/evm/types/msg.go +++ b/x/evm/types/msg.go @@ -23,6 +23,7 @@ import ( sdkmath "cosmossdk.io/math" errorsmod "cosmossdk.io/errors" + txsigning "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -40,6 +41,7 @@ import ( "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" + evmapi "github.com/evmos/ethermint/api/ethermint/evm/v1" ) var ( @@ -57,6 +59,11 @@ const ( TypeMsgEthereumTx = "ethereum_tx" ) +var MsgEthereumTxCustomGetSigner = txsigning.CustomGetSigner{ + MsgType: protov2.MessageName(&evmapi.MsgEthereumTx{}), + Fn: evmapi.GetSigners, +} + // NewTx returns a reference to a new Ethereum transaction message. func NewTx( chainID *big.Int, nonce uint64, to *common.Address, amount *big.Int, diff --git a/x/evm/types/msg_test.go b/x/evm/types/msg_test.go index b997290553..e121e54b4d 100644 --- a/x/evm/types/msg_test.go +++ b/x/evm/types/msg_test.go @@ -52,7 +52,7 @@ func (suite *MsgsTestSuite) SetupTest() { suite.chainID = big.NewInt(1) suite.hundredBigInt = big.NewInt(100) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeTestConfig(app.ModuleBasics) suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) } diff --git a/x/evm/types/utils_test.go b/x/evm/types/utils_test.go index 500071dd70..9239abdd85 100644 --- a/x/evm/types/utils_test.go +++ b/x/evm/types/utils_test.go @@ -52,7 +52,7 @@ func TestUnwrapEthererumMsg(t *testing.T) { _, err := evmtypes.UnwrapEthereumMsg(nil, common.Hash{}) require.NotNil(t, err) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeTestConfig(app.ModuleBasics) clientCtx := client.Context{}.WithTxConfig(encodingConfig.TxConfig) builder, _ := clientCtx.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder) diff --git a/x/feemarket/keeper/integration_test.go b/x/feemarket/keeper/integration_test.go index ad363f9e32..14bbfd95a2 100644 --- a/x/feemarket/keeper/integration_test.go +++ b/x/feemarket/keeper/integration_test.go @@ -498,7 +498,7 @@ func setupChain(localMinGasPricesStr string) { baseapp.SetChainID("ethermint_9000-1"), ) - genesisState := app.NewTestGenesisState(newapp.AppCodec()) + genesisState := newapp.DefaultGenesis() genesisState[types.ModuleName] = newapp.AppCodec().MustMarshalJSON(types.DefaultGenesisState()) stateBytes, err := json.MarshalIndent(genesisState, "", " ") @@ -560,7 +560,7 @@ func buildEthTx( } func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgEthereumTx) []byte { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeTestConfig(app.ModuleBasics) option, err := codectypes.NewAnyWithValue(&evmtypes.ExtensionOptionsEthereumTx{}) s.Require().NoError(err) @@ -619,7 +619,7 @@ func deliverEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgEthereu } func prepareCosmosTx(priv *ethsecp256k1.PrivKey, gasPrice *sdkmath.Int, msgs ...sdk.Msg) []byte { - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeTestConfig(app.ModuleBasics) accountAddress := sdk.AccAddress(priv.PubKey().Address().Bytes()) txBuilder := encodingConfig.TxConfig.NewTxBuilder() diff --git a/x/feemarket/keeper/keeper_test.go b/x/feemarket/keeper/keeper_test.go index ee40a6a07b..01998ce584 100644 --- a/x/feemarket/keeper/keeper_test.go +++ b/x/feemarket/keeper/keeper_test.go @@ -136,7 +136,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) { require.NoError(t, err) suite.app.StakingKeeper.SetValidator(suite.ctx, validator) - encodingConfig := encoding.MakeConfig(app.ModuleBasics) + encodingConfig := encoding.MakeTestConfig(app.ModuleBasics) suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID()) suite.appCodec = encodingConfig.Codec diff --git a/x/feemarket/migrations/v2/migrate_test.go b/x/feemarket/migrations/v2/migrate_test.go index 37863547b3..f837fcdf86 100644 --- a/x/feemarket/migrations/v2/migrate_test.go +++ b/x/feemarket/migrations/v2/migrate_test.go @@ -23,7 +23,7 @@ import ( ) func TestMigrateStore(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) feemarketKey := storetypes.NewKVStoreKey(feemarkettypes.StoreKey) tFeeMarketKey := storetypes.NewTransientStoreKey(fmt.Sprintf("%s_test", feemarkettypes.StoreKey)) ctx := testutil.DefaultContext(feemarketKey, tFeeMarketKey) @@ -71,7 +71,7 @@ func TestMigrateJSON(t *testing.T) { "no_base_fee": false } }` - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) var genState v1.GenesisState err := encCfg.Codec.UnmarshalJSON([]byte(rawJson), &genState) require.NoError(t, err) diff --git a/x/feemarket/migrations/v3/migrate_test.go b/x/feemarket/migrations/v3/migrate_test.go index b0dfca64c0..0323228959 100644 --- a/x/feemarket/migrations/v3/migrate_test.go +++ b/x/feemarket/migrations/v3/migrate_test.go @@ -26,7 +26,7 @@ func init() { } func TestMigrateStore(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) feemarketKey := storetypes.NewKVStoreKey(feemarkettypes.StoreKey) tFeeMarketKey := storetypes.NewTransientStoreKey(fmt.Sprintf("%s_test", feemarkettypes.StoreKey)) ctx := testutil.DefaultContext(feemarketKey, tFeeMarketKey) @@ -77,7 +77,7 @@ func TestMigrateJSON(t *testing.T) { "no_base_fee": false } }` - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) var genState v2types.GenesisState err := encCfg.Codec.UnmarshalJSON([]byte(rawJson), &genState) require.NoError(t, err) diff --git a/x/feemarket/migrations/v4/migrate_test.go b/x/feemarket/migrations/v4/migrate_test.go index bb2b15a48e..9d583f3469 100644 --- a/x/feemarket/migrations/v4/migrate_test.go +++ b/x/feemarket/migrations/v4/migrate_test.go @@ -31,7 +31,7 @@ func (ms mockSubspace) GetParamSetIfExists(ctx sdk.Context, ps types.LegacyParam } func TestMigrate(t *testing.T) { - encCfg := encoding.MakeConfig(app.ModuleBasics) + encCfg := encoding.MakeTestConfig(app.ModuleBasics) cdc := encCfg.Codec storeKey := storetypes.NewKVStoreKey(types.ModuleName)