@@ -132,7 +132,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
132132
133133 // Next, fetch the node from the database to ensure everything was
134134 // serialized properly.
135- dbNode , err := graph .FetchLightningNode (testPub )
135+ dbNode , err := graph .FetchLightningNode (ctx , testPub )
136136 require .NoError (t , err , "unable to locate node" )
137137
138138 _ , exists , err := graph .HasLightningNode (dbNode .PubKeyBytes )
@@ -170,7 +170,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
170170
171171 // Finally, attempt to fetch the node again. This should fail as the
172172 // node should have been deleted from the database.
173- _ , err = graph .FetchLightningNode (testPub )
173+ _ , err = graph .FetchLightningNode (ctx , testPub )
174174 require .ErrorIs (t , err , ErrGraphNodeNotFound )
175175
176176 // Now, we'll specifically test the updating of addresses of a node
@@ -192,7 +192,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
192192 require .NoError (t , graph .AddLightningNode (ctx , node ))
193193
194194 // Fetch the node and assert the empty addresses.
195- dbNode , err = graph .FetchLightningNode (testPub )
195+ dbNode , err = graph .FetchLightningNode (ctx , testPub )
196196 require .NoError (t , err )
197197 require .Empty (t , dbNode .Addresses )
198198
@@ -219,7 +219,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
219219 require .NoError (t , graph .AddLightningNode (ctx , node ))
220220
221221 // Fetch the node and assert the updated addresses.
222- dbNode , err = graph .FetchLightningNode (testPub )
222+ dbNode , err = graph .FetchLightningNode (ctx , testPub )
223223 require .NoError (t , err )
224224 require .Equal (t , expAddrs , dbNode .Addresses )
225225
@@ -240,7 +240,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
240240 require .NoError (t , graph .AddLightningNode (ctx , node ))
241241
242242 // Fetch the node and assert the updated addresses.
243- dbNode , err = graph .FetchLightningNode (testPub )
243+ dbNode , err = graph .FetchLightningNode (ctx , testPub )
244244 require .NoError (t , err )
245245 require .Equal (t , expAddrs , dbNode .Addresses )
246246
@@ -253,7 +253,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
253253 require .NoError (t , graph .AddLightningNode (ctx , node ))
254254
255255 // Fetch the node and assert the updated addresses.
256- dbNode , err = graph .FetchLightningNode (testPub )
256+ dbNode , err = graph .FetchLightningNode (ctx , testPub )
257257 require .NoError (t , err )
258258 require .Equal (t , expAddrs , dbNode .Addresses )
259259}
@@ -262,6 +262,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
262262// only the pubkey is known to the database.
263263func TestPartialNode (t * testing.T ) {
264264 t .Parallel ()
265+ ctx := context .Background ()
265266
266267 graph := MakeTestGraphNew (t )
267268
@@ -282,9 +283,9 @@ func TestPartialNode(t *testing.T) {
282283
283284 // Next, fetch the node2 from the database to ensure everything was
284285 // serialized properly.
285- dbNode1 , err := graph .FetchLightningNode (pubKey1 )
286+ dbNode1 , err := graph .FetchLightningNode (ctx , pubKey1 )
286287 require .NoError (t , err )
287- dbNode2 , err := graph .FetchLightningNode (pubKey2 )
288+ dbNode2 , err := graph .FetchLightningNode (ctx , pubKey2 )
288289 require .NoError (t , err )
289290
290291 _ , exists , err := graph .HasLightningNode (dbNode1 .PubKeyBytes )
@@ -322,7 +323,7 @@ func TestPartialNode(t *testing.T) {
322323
323324 // Finally, attempt to fetch the node again. This should fail as the
324325 // node should have been deleted from the database.
325- _ , err = graph .FetchLightningNode (testPub )
326+ _ , err = graph .FetchLightningNode (ctx , testPub )
326327 require .ErrorIs (t , err , ErrGraphNodeNotFound )
327328}
328329
@@ -3338,7 +3339,7 @@ func TestPruneGraphNodes(t *testing.T) {
33383339
33393340 // Finally, we'll ensure that node3, the only fully unconnected node as
33403341 // properly deleted from the graph and not another node in its place.
3341- _ , err := graph .FetchLightningNode (node3 .PubKeyBytes )
3342+ _ , err := graph .FetchLightningNode (ctx , node3 .PubKeyBytes )
33423343 require .NotNil (t , err )
33433344}
33443345
@@ -3364,11 +3365,11 @@ func TestAddChannelEdgeShellNodes(t *testing.T) {
33643365
33653366 // Ensure that node1 was inserted as a full node, while node2 only has
33663367 // a shell node present.
3367- node1 , err := graph .FetchLightningNode (node1 .PubKeyBytes )
3368+ node1 , err := graph .FetchLightningNode (ctx , node1 .PubKeyBytes )
33683369 require .NoError (t , err , "unable to fetch node1" )
33693370 require .True (t , node1 .HaveNodeAnnouncement )
33703371
3371- node2 , err = graph .FetchLightningNode (node2 .PubKeyBytes )
3372+ node2 , err = graph .FetchLightningNode (ctx , node2 .PubKeyBytes )
33723373 require .NoError (t , err , "unable to fetch node2" )
33733374 require .False (t , node2 .HaveNodeAnnouncement )
33743375
@@ -4350,7 +4351,7 @@ func TestLightningNodePersistence(t *testing.T) {
43504351 require .NoError (t , err )
43514352
43524353 // Read the node from disk.
4353- diskNode , err := graph .FetchLightningNode (node .PubKeyBytes )
4354+ diskNode , err := graph .FetchLightningNode (ctx , node .PubKeyBytes )
43544355 require .NoError (t , err )
43554356
43564357 // Convert it back to a wire message.
0 commit comments