From 7288f280f6be52a08ad1bacd3666d495d2ae9654 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Fri, 9 May 2025 11:28:54 +0200 Subject: [PATCH] routing+autopilot: rename mission control store var To clearly separate the mission control DB store (which for now will remain kvdb only) from the graph store, we rename the `graphBackend` variable to `mcBackend` in the `testGraphInstance` struct. --- routing/pathfind_test.go | 28 ++++++++++++++-------------- routing/router_test.go | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/routing/pathfind_test.go b/routing/pathfind_test.go index 363858a45..42ba75019 100644 --- a/routing/pathfind_test.go +++ b/routing/pathfind_test.go @@ -212,7 +212,7 @@ func parseTestGraph(t *testing.T, useCache bool, path string) ( testAddrs = append(testAddrs, testAddr) // Next, create a temporary graph database for usage within the test. - graph, graphBackend, err := makeTestGraph(t, useCache) + graph, mcBackend, err := makeTestGraph(t, useCache) if err != nil { return nil, err } @@ -412,12 +412,12 @@ func parseTestGraph(t *testing.T, useCache bool, path string) ( } return &testGraphInstance{ - graph: graph, - graphBackend: graphBackend, - aliasMap: aliasMap, - privKeyMap: privKeyMap, - channelIDs: channelIDs, - links: links, + graph: graph, + mcBackend: mcBackend, + aliasMap: aliasMap, + privKeyMap: privKeyMap, + channelIDs: channelIDs, + links: links, }, nil } @@ -481,8 +481,8 @@ type testChannel struct { } type testGraphInstance struct { - graph *graphdb.ChannelGraph - graphBackend kvdb.Backend + graph *graphdb.ChannelGraph + mcBackend kvdb.Backend // aliasMap is a map from a node's alias to its public key. This type is // provided in order to allow easily look up from the human memorable alias @@ -749,11 +749,11 @@ func createTestGraphFromChannels(t *testing.T, useCache bool, } return &testGraphInstance{ - graph: graph, - graphBackend: graphBackend, - aliasMap: aliasMap, - privKeyMap: privKeyMap, - links: links, + graph: graph, + mcBackend: graphBackend, + aliasMap: aliasMap, + privKeyMap: privKeyMap, + links: links, }, nil } diff --git a/routing/router_test.go b/routing/router_test.go index 62a68b213..0f81bea37 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -123,7 +123,7 @@ func createTestCtxFromGraphInstanceAssumeValid(t *testing.T, mcConfig := &MissionControlConfig{Estimator: estimator} mcController, err := NewMissionController( - graphInstance.graphBackend, route.Vertex{}, mcConfig, + graphInstance.mcBackend, route.Vertex{}, mcConfig, ) require.NoError(t, err, "failed to create missioncontrol")