graph/db: let ChannelGraph init the graphCache

In this commit, we let the ChannelGraph be responsible for populating
the graphCache and then passing it to the KVStore. This is a first step
in moving the graphCache completely out of the KVStore layer.
This commit is contained in:
Elle Mouton
2025-02-18 14:23:03 -03:00
parent 00432e46f3
commit 88398e3dd9
8 changed files with 129 additions and 80 deletions

View File

@@ -1093,12 +1093,10 @@ func makeTestGraph(t *testing.T, useCache bool) (*graphdb.ChannelGraph,
t.Cleanup(backendCleanup)
graph, err := graphdb.NewChannelGraph(&graphdb.Config{
KVDB: backend,
KVStoreOpts: []graphdb.KVStoreOptionModifier{
graphdb.WithUseGraphCache(useCache),
},
})
graph, err := graphdb.NewChannelGraph(
&graphdb.Config{KVDB: backend},
graphdb.WithUseGraphCache(useCache),
)
if err != nil {
return nil, nil, err
}