From a4b8816f4ad1622c5fb9c7dc7704f0d02ca46469 Mon Sep 17 00:00:00 2001 From: Nick DeLuca Date: Mon, 2 May 2022 09:48:40 -0700 Subject: [PATCH] remove unused bank keeper dependency from account verification decorator (#1074) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The account verification decorator uses the evm keeper methods which already use the bank keeper, leaving the dependency unused. Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- app/ante/eth.go | 12 +++++------- app/ante/eth_test.go | 2 +- app/ante/handler_options.go | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/ante/eth.go b/app/ante/eth.go index 964832d9e6..a0cc9608c0 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -68,17 +68,15 @@ func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, s // EthAccountVerificationDecorator validates an account balance checks type EthAccountVerificationDecorator struct { - ak evmtypes.AccountKeeper - bankKeeper evmtypes.BankKeeper - evmKeeper EVMKeeper + ak evmtypes.AccountKeeper + evmKeeper EVMKeeper } // NewEthAccountVerificationDecorator creates a new EthAccountVerificationDecorator -func NewEthAccountVerificationDecorator(ak evmtypes.AccountKeeper, bankKeeper evmtypes.BankKeeper, ek EVMKeeper) EthAccountVerificationDecorator { +func NewEthAccountVerificationDecorator(ak evmtypes.AccountKeeper, ek EVMKeeper) EthAccountVerificationDecorator { return EthAccountVerificationDecorator{ - ak: ak, - bankKeeper: bankKeeper, - evmKeeper: ek, + ak: ak, + evmKeeper: ek, } } diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index a4ebdaf684..64c5df4310 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -59,7 +59,7 @@ func (suite AnteTestSuite) TestEthSigVerificationDecorator() { func (suite AnteTestSuite) TestNewEthAccountVerificationDecorator() { dec := ante.NewEthAccountVerificationDecorator( - suite.app.AccountKeeper, suite.app.BankKeeper, suite.app.EvmKeeper, + suite.app.AccountKeeper, suite.app.EvmKeeper, ) addr := tests.GenerateAddress() diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index 1eb9baf9ef..2c830d5896 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -53,7 +53,7 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { NewEthMempoolFeeDecorator(options.EvmKeeper), // Check eth effective gas price against minimal-gas-prices NewEthValidateBasicDecorator(options.EvmKeeper), NewEthSigVerificationDecorator(options.EvmKeeper), - NewEthAccountVerificationDecorator(options.AccountKeeper, options.BankKeeper, options.EvmKeeper), + NewEthAccountVerificationDecorator(options.AccountKeeper, options.EvmKeeper), NewEthGasConsumeDecorator(options.EvmKeeper, options.MaxTxGasWanted), NewCanTransferDecorator(options.EvmKeeper), NewEthIncrementSenderSequenceDecorator(options.AccountKeeper), // innermost AnteDecorator.