Skip to content

Commit

Permalink
polish tests - removed redundant comment, test exact number of nodes …
Browse files Browse the repository at this point in the history
…was visited
  • Loading branch information
kjezek committed Sep 4, 2024
1 parent 1901d0a commit 701dfec
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions go/database/mpt/io/parallel_visit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func TestNodeSource_CanRead_Nodes(t *testing.T) {
}

// iterate all nodes in the trie for all blocks
// and compare that the loaded nodes match the nodes in the trie
for i := uint64(0); i <= blocks; i++ {
if err := trie.VisitTrie(i, mpt.MakeVisitor(func(node mpt.Node, info mpt.NodeInfo) mpt.VisitResponse {
nodeHash, dirty := node.GetHash()
Expand Down Expand Up @@ -267,7 +266,6 @@ func TestVisit_Nodes_Iterated_Deterministic(t *testing.T) {
}

// iterate all nodes in the trie for all blocks
// and compare that the loaded nodes match the nodes in the trie
for block := uint64(0); block <= blocks; block++ {
var nodes []mpt.NodeId
if err := trie.VisitTrie(block, mpt.MakeVisitor(func(node mpt.Node, info mpt.NodeInfo) mpt.VisitResponse {
Expand Down Expand Up @@ -296,7 +294,7 @@ func TestVisit_Nodes_Iterated_Deterministic(t *testing.T) {
t.Errorf("expected node %v, got %v", want, got)
}
position++
}).AnyTimes()
}).Times(len(nodes))

if err := visitAll(&stockNodeSourceFactory{trie.Directory()}, nodeId, visitor, false); err != nil {
t.Fatalf("failed to visit nodes: %v", err)
Expand Down

0 comments on commit 701dfec

Please sign in to comment.