From d5790e077c382d1605666dee8b08387123d32ab7 Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:45:07 +0900 Subject: [PATCH] remove account unnecessary --- x/evm/keeper/context.go | 1 - x/evm/precompiles/cosmos/contract_test.go | 5 ----- x/evm/types/expected_keeper.go | 1 - 3 files changed, 7 deletions(-) diff --git a/x/evm/keeper/context.go b/x/evm/keeper/context.go index 6151390..6375378 100644 --- a/x/evm/keeper/context.go +++ b/x/evm/keeper/context.go @@ -124,7 +124,6 @@ func (k Keeper) contractCreatedHook(ctx context.Context) vm.ContractCreatedHook // convert base account to contract account only if this account is empty contractAccount := types.NewContractAccountWithAddress(contractAddr.Bytes()) contractAccount.AccountNumber = account.GetAccountNumber() - k.accountKeeper.RemoveAccount(ctx, account) k.accountKeeper.SetAccount(ctx, contractAccount) } else { // create contract account diff --git a/x/evm/precompiles/cosmos/contract_test.go b/x/evm/precompiles/cosmos/contract_test.go index f87912b..18a88f4 100644 --- a/x/evm/precompiles/cosmos/contract_test.go +++ b/x/evm/precompiles/cosmos/contract_test.go @@ -360,11 +360,6 @@ func (k MockAccountKeeper) HasAccount(ctx context.Context, addr sdk.AccAddress) return ok } -// RemoveAccount implements types.AccountKeeper. -func (k MockAccountKeeper) RemoveAccount(ctx context.Context, acc sdk.AccountI) { - delete(k.accounts, acc.GetAddress().String()) -} - // NewAccount implements types.AccountKeeper. func (k *MockAccountKeeper) NewAccount(ctx context.Context, acc sdk.AccountI) sdk.AccountI { acc.SetAccountNumber(uint64(len(k.accounts))) diff --git a/x/evm/types/expected_keeper.go b/x/evm/types/expected_keeper.go index 51fa74c..bab7c4c 100644 --- a/x/evm/types/expected_keeper.go +++ b/x/evm/types/expected_keeper.go @@ -19,7 +19,6 @@ type AccountKeeper interface { GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI SetAccount(ctx context.Context, acc sdk.AccountI) HasAccount(ctx context.Context, addr sdk.AccAddress) bool - RemoveAccount(ctx context.Context, acc sdk.AccountI) NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI NextAccountNumber(ctx context.Context) uint64