evm: ignore code bytes validation during genesis (#512)
remove comment Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
089afe41a8
commit
770ce367ac
@ -1,10 +1,8 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
ethcmn "github.com/ethereum/go-ethereum/common"
|
||||
ethermint "github.com/tharsis/ethermint/types"
|
||||
)
|
||||
|
||||
@ -13,10 +11,6 @@ func (ga GenesisAccount) Validate() error {
|
||||
if err := ethermint.ValidateAddress(ga.Address); err != nil {
|
||||
return err
|
||||
}
|
||||
if len(ethcmn.Hex2Bytes(ga.Code)) == 0 {
|
||||
return errors.New("code cannot be empty")
|
||||
}
|
||||
|
||||
return ga.Storage.Validate()
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,11 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() {
|
||||
{
|
||||
"empty account address bytes",
|
||||
GenesisAccount{
|
||||
Address: ethcmn.Address{}.String(),
|
||||
Address: "",
|
||||
Code: suite.code,
|
||||
Storage: Storage{
|
||||
NewState(suite.hash, suite.hash),
|
||||
},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -61,8 +65,11 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() {
|
||||
GenesisAccount{
|
||||
Address: suite.address,
|
||||
Code: "",
|
||||
Storage: Storage{
|
||||
NewState(suite.hash, suite.hash),
|
||||
},
|
||||
},
|
||||
false,
|
||||
true,
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user