trie, core/state: revert error removal in (*state.Trie).Commit (#27544)
* trie, core/state: revert error removal in (*state.Trie).Commit * Gary's nitpick :) Co-Authored-By: rjl493456442 <garyrong0905@gmail.com> --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This commit is contained in:
co-authored by
rjl493456442
parent
d73eb87979
commit
c7b099b2ea
@@ -1386,7 +1386,7 @@ func makeAccountTrieNoStorage(n int) (string, *trie.Trie, []*kv) {
|
||||
|
||||
// Commit the state changes into db and re-create the trie
|
||||
// for accessing later.
|
||||
root, nodes := accTrie.Commit(false)
|
||||
root, nodes, _ := accTrie.Commit(false)
|
||||
db.Update(root, types.EmptyRootHash, trienode.NewWithNodeSet(nodes))
|
||||
|
||||
accTrie, _ = trie.New(trie.StateTrieID(root), db)
|
||||
@@ -1448,7 +1448,7 @@ func makeBoundaryAccountTrie(n int) (string, *trie.Trie, []*kv) {
|
||||
|
||||
// Commit the state changes into db and re-create the trie
|
||||
// for accessing later.
|
||||
root, nodes := accTrie.Commit(false)
|
||||
root, nodes, _ := accTrie.Commit(false)
|
||||
db.Update(root, types.EmptyRootHash, trienode.NewWithNodeSet(nodes))
|
||||
|
||||
accTrie, _ = trie.New(trie.StateTrieID(root), db)
|
||||
@@ -1494,7 +1494,7 @@ func makeAccountTrieWithStorageWithUniqueStorage(accounts, slots int, code bool)
|
||||
slices.SortFunc(entries, (*kv).less)
|
||||
|
||||
// Commit account trie
|
||||
root, set := accTrie.Commit(true)
|
||||
root, set, _ := accTrie.Commit(true)
|
||||
nodes.Merge(set)
|
||||
|
||||
// Commit gathered dirty nodes into database
|
||||
@@ -1559,7 +1559,7 @@ func makeAccountTrieWithStorage(accounts, slots int, code, boundary bool) (strin
|
||||
slices.SortFunc(entries, (*kv).less)
|
||||
|
||||
// Commit account trie
|
||||
root, set := accTrie.Commit(true)
|
||||
root, set, _ := accTrie.Commit(true)
|
||||
nodes.Merge(set)
|
||||
|
||||
// Commit gathered dirty nodes into database
|
||||
@@ -1601,7 +1601,7 @@ func makeStorageTrieWithSeed(owner common.Hash, n, seed uint64, db *trie.Databas
|
||||
entries = append(entries, elem)
|
||||
}
|
||||
slices.SortFunc(entries, (*kv).less)
|
||||
root, nodes := trie.Commit(false)
|
||||
root, nodes, _ := trie.Commit(false)
|
||||
return root, nodes, entries
|
||||
}
|
||||
|
||||
@@ -1652,7 +1652,7 @@ func makeBoundaryStorageTrie(owner common.Hash, n int, db *trie.Database) (commo
|
||||
entries = append(entries, elem)
|
||||
}
|
||||
slices.SortFunc(entries, (*kv).less)
|
||||
root, nodes := trie.Commit(false)
|
||||
root, nodes, _ := trie.Commit(false)
|
||||
return root, nodes, entries
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user