graph/db: init KVStore outside of ChannelGraph

So that we can pass in the abstract V1Store in preparation for adding a
SQL implementation of the KVStore.
This commit is contained in:
Elle Mouton committed 2025-05-22 14:14:40 +02:00
1 parent 449684de87
commit 526fb7f181
8 files changed
+36 -39

No files matched your search

+5 -2
View File
@@ -4084,7 +4084,10 @@ func TestGraphLoading(t *testing.T) {
defer backend.Close()
defer backendCleanup()
graph, err := NewChannelGraph(&Config{KVDB: backend})
graphStore, err := NewKVStore(backend)
require.NoError(t, err)
graph, err := NewChannelGraph(graphStore)
require.NoError(t, err)
require.NoError(t, graph.Start())
t.Cleanup(func() {
@@ -4098,7 +4101,7 @@ func TestGraphLoading(t *testing.T) {
// Recreate the graph. This should cause the graph cache to be
// populated.
graphReloaded, err := NewChannelGraph(&Config{KVDB: backend})
graphReloaded, err := NewChannelGraph(graphStore)
require.NoError(t, err)
require.NoError(t, graphReloaded.Start())
t.Cleanup(func() {