From de11997fad8a85095dcab7b51db309150b8bafd4 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Sat, 5 Apr 2025 16:53:02 +0200 Subject: [PATCH] graph/db: use only exported KVStore methods in tests Replace all calls to bbolt specific methods on the KVStore to instead use exported methods on the KVStore that are more db-agnostic. --- graph/db/graph_test.go | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/graph/db/graph_test.go b/graph/db/graph_test.go index f7d87a1ce..26b7bede1 100644 --- a/graph/db/graph_test.go +++ b/graph/db/graph_test.go @@ -1217,26 +1217,15 @@ func TestGraphTraversalCacheable(t *testing.T) { require.NoError(t, err) require.Len(t, nodeMap, 0) - err = graph.db.View(func(tx kvdb.RTx) error { - for _, node := range nodes { - err := graph.forEachNodeChannelTx(tx, node, - func(tx kvdb.RTx, info *models.ChannelEdgeInfo, - policy *models.ChannelEdgePolicy, - policy2 *models.ChannelEdgePolicy) error { //nolint:ll - - delete(chanIndex, info.ChannelID) - return nil - }, - ) - if err != nil { - return err - } - } - - return nil - }, func() {}) - - require.NoError(t, err) + for _, node := range nodes { + err = graph.ForEachNodeDirectedChannel( + node, func(d *DirectedChannel) error { + delete(chanIndex, d.ChannelID) + return nil + }, + ) + require.NoError(t, err) + } require.Len(t, chanIndex, 0) }