Skip to content

Commit

Permalink
more consistency with other tests in the file
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Jan 19, 2022
1 parent 08b1c27 commit b5c08e2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions trie/proof_test.go
Expand Up @@ -1080,22 +1080,18 @@ func TestRangeProofKeysWithSharedPrefix(t *testing.T) {
common.Hex2Bytes("02"),
common.Hex2Bytes("03"),
}
db := memorydb.New()
tr, err := New(common.Hash{}, NewDatabase(db))
if err != nil {
t.Fatalf("could not create new trie: %v", err)
}
trie := new(Trie)
for i, key := range keys {
tr.Update(key, vals[i])
trie.Update(key, vals[i])
}
root := tr.Hash()
root := trie.Hash()
proof := memorydb.New()
start := common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000000")
end := common.Hex2Bytes("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
if err := tr.Prove(start, 0, proof); err != nil {
if err := trie.Prove(start, 0, proof); err != nil {
t.Fatalf("failed to prove start: %v", err)
}
if err := tr.Prove(end, 0, proof); err != nil {
if err := trie.Prove(end, 0, proof); err != nil {
t.Fatalf("failed to prove end: %v", err)
}

Expand Down

0 comments on commit b5c08e2

Please sign in to comment.