trie: remove redundant returns + use stacktrie where applicable (#22760)

* trie: add benchmark for proofless range

* trie: remove unused returns + use stacktrie
This commit is contained in:
Martin Holst Swende
2021-04-28 21:47:48 +02:00
committed by GitHub
parent abb6cfae6a
commit a81cf0d2b3
6 changed files with 96 additions and 97 deletions

View File

@ -170,17 +170,11 @@ func (f *fuzzer) fuzz() int {
}
ok = 1
//nodes, subtrie
nodes, subtrie, notary, hasMore, err := trie.VerifyRangeProof(tr.Hash(), first, last, keys, vals, proof)
nodes, hasMore, err := trie.VerifyRangeProof(tr.Hash(), first, last, keys, vals, proof)
if err != nil {
if nodes != nil {
panic("err != nil && nodes != nil")
}
if subtrie != nil {
panic("err != nil && subtrie != nil")
}
if notary != nil {
panic("err != nil && notary != nil")
}
if hasMore {
panic("err != nil && hasMore == true")
}
@ -188,12 +182,6 @@ func (f *fuzzer) fuzz() int {
if nodes == nil {
panic("err == nil && nodes == nil")
}
if subtrie == nil {
panic("err == nil && subtrie == nil")
}
if notary == nil {
panic("err == nil && subtrie == nil")
}
}
}
return ok