Skip to content

Commit

Permalink
remove account unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Jun 19, 2024
1 parent 2575750 commit d5790e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion x/evm/keeper/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions x/evm/precompiles/cosmos/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
1 change: 0 additions & 1 deletion x/evm/types/expected_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d5790e0

Please sign in to comment.