graph/db+chanbackup: dns add encoding/decoding for persistence

This commit is contained in:
Elle Mouton authored and Mohamed Awnallah committed 2025-09-03 01:11:35 +00:00
1 parent 4bd2bbca27
commit 6ef80db746
7 files changed
+107 -11

No files matched your search

+1
View File
@@ -160,6 +160,7 @@ func TestFetchStaticChanBackups(t *testing.T) {
chanSource.addAddrsForNode(randomChan2.IdentityPub, []net.Addr{addr2})
chanSource.addAddrsForNode(randomChan2.IdentityPub, []net.Addr{addr3})
chanSource.addAddrsForNode(randomChan2.IdentityPub, []net.Addr{addr4})
chanSource.addAddrsForNode(randomChan2.IdentityPub, []net.Addr{addr5})
// With the channel source populated, we'll now attempt to create a set
// of backups for all the channels. This should succeed, as all items
+1 -1
View File
@@ -23,7 +23,7 @@ func TestMultiPackUnpack(t *testing.T) {
}
single := NewSingle(
channel, []net.Addr{addr1, addr2, addr3, addr4},
channel, []net.Addr{addr1, addr2, addr3, addr4, addr5},
)
originalSingles = append(originalSingles, single)
+7 -3
View File
@@ -41,7 +41,11 @@ var (
OnionService: "3g2upl4pq6kufc4m.onion",
Port: 9735,
}
addr4 = &lnwire.OpaqueAddrs{
addr4 = &lnwire.DNSAddress{
Hostname: "example.com",
Port: 8080,
}
addr5 = &lnwire.OpaqueAddrs{
// The first byte must be an address type we are not yet aware
// of for it to be a valid OpaqueAddrs.
Payload: []byte{math.MaxUint8, 1, 2, 3, 4},
@@ -320,7 +324,7 @@ func TestSinglePackUnpack(t *testing.T) {
require.NoError(t, err, "unable to gen open channel")
singleChanBackup := NewSingle(
channel, []net.Addr{addr1, addr2, addr3, addr4},
channel, []net.Addr{addr1, addr2, addr3, addr4, addr5},
)
keyRing := &lnencrypt.MockKeyRing{}
@@ -647,7 +651,7 @@ func TestSingleUnconfirmedChannel(t *testing.T) {
channel.FundingBroadcastHeight = fundingBroadcastHeight
singleChanBackup := NewSingle(
channel, []net.Addr{addr1, addr2, addr3, addr4},
channel, []net.Addr{addr1, addr2, addr3, addr4, addr5},
)
keyRing := &lnencrypt.MockKeyRing{}