From 2f96588c73b87ec23ff78d32e96ae8dfd35e256b Mon Sep 17 00:00:00 2001 From: huangyi Date: Thu, 15 Aug 2024 11:20:38 +0800 Subject: [PATCH] rename --- app/ante/eth.go | 2 +- app/ante/eth_test.go | 6 +++--- app/ante/handler_options.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/ante/eth.go b/app/ante/eth.go index 73b35767d9..4f21d3c99b 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -39,7 +39,7 @@ import ( // it's safe because there's no store branching in the ante handlers. type AccountGetter func(sdk.AccAddress) sdk.AccountI -func NewAccountGetter(ctx sdk.Context, ak evmtypes.AccountKeeper) AccountGetter { +func NewCachedAccountGetter(ctx sdk.Context, ak evmtypes.AccountKeeper) AccountGetter { accounts := make(map[string]sdk.AccountI, 1) return func(addr sdk.AccAddress) sdk.AccountI { acc := accounts[string(addr)] diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index 6d0fd754f1..c44863db27 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -92,7 +92,7 @@ func (suite *AnteTestSuite) TestNewEthAccountVerificationDecorator() { tc.malleate() suite.Require().NoError(vmdb.Commit()) - accountGetter := ante.NewAccountGetter(suite.ctx, suite.app.AccountKeeper) + accountGetter := ante.NewCachedAccountGetter(suite.ctx, suite.app.AccountKeeper) err := ante.VerifyEthAccount(suite.ctx.WithIsCheckTx(tc.checkTx), tc.tx, suite.app.EvmKeeper, evmtypes.DefaultEVMDenom, accountGetter) if tc.expPass { @@ -148,7 +148,7 @@ func (suite *AnteTestSuite) TestEthNonceVerificationDecorator() { for _, tc := range testCases { suite.Run(tc.name, func() { tc.malleate() - accountGetter := ante.NewAccountGetter(suite.ctx, suite.app.AccountKeeper) + accountGetter := ante.NewCachedAccountGetter(suite.ctx, suite.app.AccountKeeper) err := ante.CheckAndSetEthSenderNonce(suite.ctx.WithIsReCheckTx(tc.reCheckTx), tc.tx, suite.app.AccountKeeper, false, accountGetter) if tc.expPass { @@ -538,7 +538,7 @@ func (suite *AnteTestSuite) TestEthIncrementSenderSequenceDecorator() { for _, tc := range testCases { suite.Run(tc.name, func() { tc.malleate() - accountGetter := ante.NewAccountGetter(suite.ctx, suite.app.AccountKeeper) + accountGetter := ante.NewCachedAccountGetter(suite.ctx, suite.app.AccountKeeper) if tc.expPanic { suite.Require().Panics(func() { diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index 5bc82486b6..ccf446a88a 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -127,7 +127,7 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { // AccountGetter cache the account objects during the ante handler execution, // it's safe because there's no store branching in the ante handlers. - accountGetter := NewAccountGetter(ctx, options.AccountKeeper) + accountGetter := NewCachedAccountGetter(ctx, options.AccountKeeper) if err := VerifyEthAccount(ctx, tx, options.EvmKeeper, evmDenom, accountGetter); err != nil { return ctx, err