multi: remove the NodeRTx interface type

This commit is contained in:
Elle Mouton committed 2025-08-06 09:56:21 +02:00
1 parent 15e17e1270
commit 8aa8c7cc42
10 files changed
+58 -155

No files matched your search

+9 -8
View File
@@ -1469,8 +1469,8 @@ 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(ctx, func(tx NodeRTx) error {
nodeMap[tx.Node().PubKeyBytes] = struct{}{}
err := graph.ForEachNode(ctx, func(n *models.LightningNode) error {
nodeMap[n.PubKeyBytes] = struct{}{}
return nil
}, func() {})
@@ -1601,8 +1601,8 @@ 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(ctx, func(tx NodeRTx) error {
delete(nodeIndex, tx.Node().Alias)
err := graph.ForEachNode(ctx, func(n *models.LightningNode) error {
delete(nodeIndex, n.Alias)
return nil
}, func() {})
require.NoError(t, err)
@@ -1710,11 +1710,12 @@ func assertNumChans(t *testing.T, graph *ChannelGraph, n int) {
func assertNumNodes(t *testing.T, graph *ChannelGraph, n int) {
numNodes := 0
err := graph.ForEachNode(context.Background(), func(tx NodeRTx) error {
numNodes++
err := graph.ForEachNode(context.Background(),
func(_ *models.LightningNode) error {
numNodes++
return nil
}, func() {})
return nil
}, func() {})
if err != nil {
_, _, line, _ := runtime.Caller(1)
t.Fatalf("line %v: unable to scan nodes: %v", line, err)