channeldb+graphdb: init graph DB outside of channel db
We also now use the graph DB's own optional functions. An instance of the graph is currently still passed to the channeldb's `CreateWithBackend` function. This will be removed in a later commit once the two have been completely disjoint.
This commit is contained in:
11 files changed
+98
-203
No files matched your search
+3
-16
@@ -79,11 +79,7 @@ func MakeTestGraph(t testing.TB, modifiers ...OptionModifier) (*ChannelGraph, er
|
||||
return nil, err
|
||||
}
|
||||
|
||||
graph, err := NewChannelGraph(
|
||||
backend, opts.RejectCacheSize, opts.ChannelCacheSize,
|
||||
opts.BatchCommitInterval, opts.PreAllocCacheNumNodes,
|
||||
true, false,
|
||||
)
|
||||
graph, err := NewChannelGraph(backend)
|
||||
if err != nil {
|
||||
backendCleanup()
|
||||
return nil, err
|
||||
@@ -4016,12 +4012,7 @@ func TestGraphLoading(t *testing.T) {
|
||||
defer backend.Close()
|
||||
defer backendCleanup()
|
||||
|
||||
opts := DefaultOptions()
|
||||
graph, err := NewChannelGraph(
|
||||
backend, opts.RejectCacheSize, opts.ChannelCacheSize,
|
||||
opts.BatchCommitInterval, opts.PreAllocCacheNumNodes,
|
||||
true, false,
|
||||
)
|
||||
graph, err := NewChannelGraph(backend)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Populate the graph with test data.
|
||||
@@ -4031,11 +4022,7 @@ func TestGraphLoading(t *testing.T) {
|
||||
|
||||
// Recreate the graph. This should cause the graph cache to be
|
||||
// populated.
|
||||
graphReloaded, err := NewChannelGraph(
|
||||
backend, opts.RejectCacheSize, opts.ChannelCacheSize,
|
||||
opts.BatchCommitInterval, opts.PreAllocCacheNumNodes,
|
||||
true, false,
|
||||
)
|
||||
graphReloaded, err := NewChannelGraph(backend)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Assert that the cache content is identical.
|
||||
|
||||
Reference in new issue
Block a user