From e0299764da462364183ac8f0278cce2adcaec834 Mon Sep 17 00:00:00 2001 From: testinginprod Date: Thu, 17 Oct 2024 11:53:58 +0200 Subject: [PATCH] lfg --- x/accounts/defaults/base/utils_test.go | 12 ++++++++++-- x/auth/ante/ante_test.go | 4 ++++ x/auth/ante/sigverify_test.go | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/x/accounts/defaults/base/utils_test.go b/x/accounts/defaults/base/utils_test.go index 93cd76ea8495..5d1a91893064 100644 --- a/x/accounts/defaults/base/utils_test.go +++ b/x/accounts/defaults/base/utils_test.go @@ -66,6 +66,13 @@ func newMockContext(t *testing.T) (context.Context, store.KVStoreService) { ) } +type transactionService struct { +} + +func (t transactionService) ExecMode(ctx context.Context) transaction.ExecMode { + return transaction.ExecModeFinalize +} + func makeMockDependencies(storeservice store.KVStoreService) accountstd.Dependencies { sb := collections.NewSchemaBuilder(storeservice) @@ -74,8 +81,9 @@ func makeMockDependencies(storeservice store.KVStoreService) accountstd.Dependen AddressCodec: addressCodec{}, LegacyStateCodec: mockStateCodec{}, Environment: appmodulev2.Environment{ - EventService: eventService{}, - HeaderService: headerService{}, + EventService: eventService{}, + HeaderService: headerService{}, + TransactionService: transactionService{}, }, } } diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index fbc4491b9091..0078c2a9803f 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -915,6 +915,8 @@ func TestAnteHandlerBadSignBytes(t *testing.T) { suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) require.NoError(t, accs[0].acc.SetSequence(2)) // wrong accSeq + suite.ctx = suite.ctx.WithExecMode(sdk.ExecModeFinalize) + return TestCaseArgs{ chainID: suite.ctx.ChainID(), feeAmount: feeAmount, @@ -1081,6 +1083,8 @@ func TestAnteHandlerSetPubKey(t *testing.T) { accs := suite.CreateTestAccounts(2) suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) + suite.ctx = suite.ctx.WithExecMode(sdk.ExecModeFinalize) + // Make sure public key has not been set from previous test. acc1 := suite.accountKeeper.GetAccount(suite.ctx, accs[1].acc.GetAddress()) require.Nil(t, acc1.GetPubKey()) diff --git a/x/auth/ante/sigverify_test.go b/x/auth/ante/sigverify_test.go index 00cbb6db6051..d14761fd8aa5 100644 --- a/x/auth/ante/sigverify_test.go +++ b/x/auth/ante/sigverify_test.go @@ -231,7 +231,7 @@ func TestSigVerification(t *testing.T) { if tc.recheck { ctx = ctx.WithExecMode(sdk.ExecModeReCheck) } else { - ctx = ctx.WithExecMode(sdk.ExecModeCheck) + ctx = ctx.WithExecMode(sdk.ExecModeFinalize) } suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder() // Create new txBuilder for each test