multi: carve out LinkNodeDB from channeldb.DB for cleaner separation

This commit is contained in:
Andras Banki-Horvath authored and Oliver Gugger committed 2021-09-29 17:00:02 +02:00
1 parent 292b8e1ce6
commit 60cccf8409
6 files changed
+115 -65

No files matched your search

+5 -3
View File
@@ -210,8 +210,8 @@ func TestAddrsForNode(t *testing.T) {
if err != nil {
t.Fatalf("unable to recv node pub: %v", err)
}
linkNode := cdb.NewLinkNode(
wire.MainNet, nodePub, anotherAddr,
linkNode := NewLinkNode(
cdb.linkNodeDB, wire.MainNet, nodePub, anotherAddr,
)
if err := linkNode.Sync(); err != nil {
t.Fatalf("unable to sync link node: %v", err)
@@ -423,7 +423,9 @@ func TestRestoreChannelShells(t *testing.T) {
// We should also be able to find the link node that was inserted by
// its public key.
linkNode, err := cdb.FetchLinkNode(channelShell.Chan.IdentityPub)
linkNode, err := cdb.linkNodeDB.FetchLinkNode(
channelShell.Chan.IdentityPub,
)
if err != nil {
t.Fatalf("unable to fetch link node: %v", err)
}