diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index cb6220fc..f9bd9b9b 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -8,8 +8,8 @@ import ( authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - channelkeeper "github.com/cosmos/ibc-go/v3/modules/core/04-channel/keeper" ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" evmtypes "github.com/tharsis/ethermint/x/evm/types" ) @@ -17,14 +17,14 @@ import ( // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC // channel keeper, EVM Keeper and Fee Market Keeper. type HandlerOptions struct { - AccountKeeper evmtypes.AccountKeeper - BankKeeper evmtypes.BankKeeper - IBCChannelKeeper channelkeeper.Keeper - FeeMarketKeeper evmtypes.FeeMarketKeeper - EvmKeeper EVMKeeper - FeegrantKeeper ante.FeegrantKeeper - SignModeHandler authsigning.SignModeHandler - SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error + AccountKeeper evmtypes.AccountKeeper + BankKeeper evmtypes.BankKeeper + IBCKeeper *ibckeeper.Keeper + FeeMarketKeeper evmtypes.FeeMarketKeeper + EvmKeeper EVMKeeper + FeegrantKeeper ante.FeegrantKeeper + SignModeHandler authsigning.SignModeHandler + SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error } func (options HandlerOptions) Validate() error { @@ -76,7 +76,7 @@ func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler { ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer), ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), ante.NewIncrementSequenceDecorator(options.AccountKeeper), - ibcante.NewAnteDecorator(options.IBCChannelKeeper), + ibcante.NewAnteDecorator(options.IBCKeeper), ) } @@ -99,6 +99,6 @@ func newCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler { // Note: signature verification uses EIP instead of the cosmos signature validator NewEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), ante.NewIncrementSequenceDecorator(options.AccountKeeper), - ibcante.NewAnteDecorator(options.IBCChannelKeeper), + ibcante.NewAnteDecorator(options.IBCKeeper), ) } diff --git a/app/ante/utils_test.go b/app/ante/utils_test.go index 76c74806..1375bde8 100644 --- a/app/ante/utils_test.go +++ b/app/ante/utils_test.go @@ -1,6 +1,10 @@ package ante_test import ( + "math" + "testing" + "time" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" types2 "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -8,9 +12,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/tharsis/ethermint/ethereum/eip712" "github.com/tharsis/ethermint/types" - "math" - "testing" - "time" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -96,14 +97,14 @@ func (suite *AnteTestSuite) SetupTest() { suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) options := ante.HandlerOptions{ - AccountKeeper: suite.app.AccountKeeper, - BankKeeper: suite.app.BankKeeper, - EvmKeeper: suite.app.EvmKeeper, - FeegrantKeeper: suite.app.FeeGrantKeeper, - IBCChannelKeeper: suite.app.IBCKeeper.ChannelKeeper, - FeeMarketKeeper: suite.app.FeeMarketKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + AccountKeeper: suite.app.AccountKeeper, + BankKeeper: suite.app.BankKeeper, + EvmKeeper: suite.app.EvmKeeper, + FeegrantKeeper: suite.app.FeeGrantKeeper, + IBCKeeper: suite.app.IBCKeeper, + FeeMarketKeeper: suite.app.FeeMarketKeeper, + SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, } suite.Require().NoError(options.Validate()) diff --git a/app/app.go b/app/app.go index d50d6614..af4be4bc 100644 --- a/app/app.go +++ b/app/app.go @@ -568,14 +568,14 @@ func NewEthermintApp( // use Ethermint's custom AnteHandler options := ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - EvmKeeper: app.EvmKeeper, - FeegrantKeeper: app.FeeGrantKeeper, - IBCChannelKeeper: app.IBCKeeper.ChannelKeeper, - FeeMarketKeeper: app.FeeMarketKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + EvmKeeper: app.EvmKeeper, + FeegrantKeeper: app.FeeGrantKeeper, + IBCKeeper: app.IBCKeeper, + FeeMarketKeeper: app.FeeMarketKeeper, + SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, } if err := options.Validate(); err != nil { @@ -755,7 +755,8 @@ func GetMaccPerms() map[string][]string { // initParamsKeeper init params keeper and its subspaces func initParamsKeeper( - appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { + appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey, +) paramskeeper.Keeper { paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) // SDK subspaces diff --git a/go.mod b/go.mod index 8c5830d5..1f937373 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/cosmos/cosmos-sdk v0.45.1 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-go/v3 v3.0.0-rc1 + github.com/cosmos/ibc-go/v3 v3.0.0-rc2 github.com/davecgh/go-spew v1.1.1 github.com/ethereum/go-ethereum v1.10.16 github.com/gogo/protobuf v1.3.3 diff --git a/go.sum b/go.sum index 71dd13e4..1ec01424 100644 --- a/go.sum +++ b/go.sum @@ -234,8 +234,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= -github.com/cosmos/ibc-go/v3 v3.0.0-rc1 h1:5yDwMTKrBD1WJL5p/PPMalmJEOlng0OS0uX0WfFvgcw= -github.com/cosmos/ibc-go/v3 v3.0.0-rc1/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY= +github.com/cosmos/ibc-go/v3 v3.0.0-rc2 h1:ttolImqsdf/KOGUSU3ok5yaf9rIMdTaaNNCwuBnHfNQ= +github.com/cosmos/ibc-go/v3 v3.0.0-rc2/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=