diff --git a/graph/db/graph_test.go b/graph/db/graph_test.go index 155429b62..5e445f10d 100644 --- a/graph/db/graph_test.go +++ b/graph/db/graph_test.go @@ -1103,13 +1103,11 @@ func TestGraphTraversalCacheable(t *testing.T) { // Create a map of all nodes with the iteration we know works (because // it is tested in another test). nodeMap := make(map[route.Vertex]struct{}) - err = graph.forEachNode( - func(tx kvdb.RTx, n *models.LightningNode) error { - nodeMap[n.PubKeyBytes] = struct{}{} + err = graph.ForEachNode(func(tx NodeRTx) error { + nodeMap[tx.Node().PubKeyBytes] = struct{}{} - return nil - }, - ) + return nil + }) require.NoError(t, err) require.Len(t, nodeMap, numNodes) @@ -1225,12 +1223,10 @@ func fillTestGraph(t testing.TB, graph *ChannelGraph, numNodes, // Iterate over each node as returned by the graph, if all nodes are // reached, then the map created above should be empty. - err := graph.forEachNode( - func(_ kvdb.RTx, node *models.LightningNode) error { - delete(nodeIndex, node.Alias) - return nil - }, - ) + err := graph.ForEachNode(func(tx NodeRTx) error { + delete(nodeIndex, tx.Node().Alias) + return nil + }) require.NoError(t, err) require.Len(t, nodeIndex, 0) @@ -1337,12 +1333,11 @@ func assertNumChans(t *testing.T, graph *ChannelGraph, n int) { func assertNumNodes(t *testing.T, graph *ChannelGraph, n int) { numNodes := 0 - err := graph.forEachNode( - func(_ kvdb.RTx, _ *models.LightningNode) error { - numNodes++ - return nil - }, - ) + err := graph.ForEachNode(func(tx NodeRTx) error { + numNodes++ + + return nil + }) if err != nil { _, _, line, _ := runtime.Caller(1) t.Fatalf("line %v: unable to scan nodes: %v", line, err)