From 20490570a023b0075dd7a079a48d4a723f112f0e Mon Sep 17 00:00:00 2001 From: jay tseng Date: Thu, 22 Sep 2022 10:56:29 -0400 Subject: [PATCH] add test --- x/evm/genesis_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/x/evm/genesis_test.go b/x/evm/genesis_test.go index 0f65bf0a9a..e060c5d965 100644 --- a/x/evm/genesis_test.go +++ b/x/evm/genesis_test.go @@ -7,6 +7,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/evmos/ethermint/crypto/ethsecp256k1" + etherminttypes "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm" "github.com/evmos/ethermint/x/evm/statedb" "github.com/evmos/ethermint/x/evm/types" @@ -114,6 +115,27 @@ func (suite *EvmTestSuite) TestInitGenesis() { }, false, }, + { + "ignore empty account code checking with non-empty codehash", + func() { + ethAcc := ðerminttypes.EthAccount{ + BaseAccount: authtypes.NewBaseAccount(address.Bytes(), nil, 0, 0), + CodeHash: common.BytesToHash([]byte{1, 2, 3}).Hex(), + } + + suite.app.AccountKeeper.SetAccount(suite.ctx, ethAcc) + }, + &types.GenesisState{ + Params: types.DefaultParams(), + Accounts: []types.GenesisAccount{ + { + Address: address.String(), + Code: "", + }, + }, + }, + false, + }, } for _, tc := range testCases {