mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 11:23:13 +02:00
routing: introduce missionControlDB
abstraction
So that `missionControlStore` can be unaware of the backing DB structure it is writing to. In an upcoming commit when we change mission control to write to namespaced buckets instead, we then only need to update the `namespacedDB` implementation.
This commit is contained in:
@@ -62,7 +62,9 @@ func newMCStoreTestHarness(t testing.TB, maxRecords int,
|
||||
require.NoError(t, db.Close())
|
||||
})
|
||||
|
||||
store, err := newMissionControlStore(db, maxRecords, flushInterval)
|
||||
store, err := newMissionControlStore(
|
||||
newNamespacedDB(db), maxRecords, flushInterval,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
return mcStoreTestHarness{db: db, store: store}
|
||||
@@ -115,7 +117,9 @@ func TestMissionControlStore(t *testing.T) {
|
||||
require.Equal(t, &result2, results[1])
|
||||
|
||||
// Recreate store to test pruning.
|
||||
store, err = newMissionControlStore(db, testMaxRecords, time.Second)
|
||||
store, err = newMissionControlStore(
|
||||
newNamespacedDB(db), testMaxRecords, time.Second,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Add a newer result which failed due to mpp timeout.
|
||||
@@ -213,7 +217,9 @@ func TestMissionControlStoreFlushing(t *testing.T) {
|
||||
store.stop()
|
||||
|
||||
// Recreate store.
|
||||
store, err := newMissionControlStore(db, testMaxRecords, flushInterval)
|
||||
store, err := newMissionControlStore(
|
||||
newNamespacedDB(db), testMaxRecords, flushInterval,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
store.run()
|
||||
defer store.stop()
|
||||
|
Reference in New Issue
Block a user