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:
8 files changed
+36
-39
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user