all: new empty trie with types.EmptyRootHash instead of null (#27230)

This commit is contained in:
rjl493456442
2023-05-11 10:19:42 +03:00
committed by GitHub
parent 7577b9c28f
commit a14301823e
25 changed files with 121 additions and 113 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ func (t *StateTest) gasLimit(subtest StateSubtest) uint64 {
func MakePreState(db ethdb.Database, accounts core.GenesisAlloc, snapshotter bool) (*snapshot.Tree, *state.StateDB) {
sdb := state.NewDatabaseWithConfig(db, &trie.Config{Preimages: true})
statedb, _ := state.New(common.Hash{}, sdb, nil)
statedb, _ := state.New(types.EmptyRootHash, sdb, nil)
for addr, a := range accounts {
statedb.SetCode(addr, a.Code)
statedb.SetNonce(addr, a.Nonce)