Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
JayT106 committed Oct 17, 2022
1 parent 9019d44 commit 2049057
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions x/evm/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -114,6 +115,27 @@ func (suite *EvmTestSuite) TestInitGenesis() {
},
false,
},
{
"ignore empty account code checking with non-empty codehash",
func() {
ethAcc := &etherminttypes.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 {
Expand Down

0 comments on commit 2049057

Please sign in to comment.