From 8bf10b183d20c8028ff6ca8124c79b0d94589be1 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Sat, 5 Apr 2025 17:03:42 +0200 Subject: [PATCH] graph/db: make all ExtraOpaqueData valid TLV streams Later when we introduce our SQL version of the graph store, we will normalise the persistence of the ExtraOpaqueData using the fact that it is always made up of TLV entries. So we update our tests here to ensure that they use valid TLV streams as examples. --- graph/db/graph_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/graph/db/graph_test.go b/graph/db/graph_test.go index 4551a29c5..a543772a4 100644 --- a/graph/db/graph_test.go +++ b/graph/db/graph_test.go @@ -110,7 +110,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) { Alias: "kek", Features: testFeatures, Addresses: testAddrs, - ExtraOpaqueData: []byte("extra new data"), + ExtraOpaqueData: []byte{1, 1, 1, 2, 2, 2, 2}, PubKeyBytes: testPub, } @@ -631,9 +631,13 @@ func createChannelEdge(node1, node2 *models.LightningNode) ( BitcoinSig1Bytes: testSig.Serialize(), BitcoinSig2Bytes: testSig.Serialize(), }, - ChannelPoint: outpoint, - Capacity: 1000, - ExtraOpaqueData: []byte("new unknown feature"), + ChannelPoint: outpoint, + Capacity: 1000, + ExtraOpaqueData: []byte{ + 1, 1, 1, + 2, 2, 2, 2, + 3, 3, 3, 3, 3, + }, } copy(edgeInfo.NodeKey1Bytes[:], firstNode[:]) copy(edgeInfo.NodeKey2Bytes[:], secondNode[:])