core/state, trie: remove unused error-return from trie Commit operation (#26641)

This commit is contained in:
Martin Holst Swende
2023-02-09 08:56:59 -05:00
committed by GitHub
parent 3086c256c9
commit 22c3ad1d12
18 changed files with 72 additions and 131 deletions
+2 -7
View File
@@ -182,10 +182,7 @@ func (f *fuzzer) fuzz() int {
return 0
}
// Flush trie -> database
rootA, nodes, err := trieA.Commit(false)
if err != nil {
panic(err)
}
rootA, nodes := trieA.Commit(false)
if nodes != nil {
dbA.Update(trie.NewWithNodeSet(nodes))
}
@@ -201,9 +198,7 @@ func (f *fuzzer) fuzz() int {
trieB.Update(kv.k, kv.v)
}
rootB := trieB.Hash()
if _, err := trieB.Commit(); err != nil {
panic(err)
}
trieB.Commit()
if rootA != rootB {
panic(fmt.Sprintf("roots differ: (trie) %x != %x (stacktrie)", rootA, rootB))
}
+1 -4
View File
@@ -161,10 +161,7 @@ func runRandTest(rt randTest) error {
case opHash:
tr.Hash()
case opCommit:
hash, nodes, err := tr.Commit(false)
if err != nil {
return err
}
hash, nodes := tr.Commit(false)
if nodes != nil {
if err := triedb.Update(trie.NewWithNodeSet(nodes)); err != nil {
return err