@@ -2,6 +2,7 @@ package graph
22
33import (
44 "bytes"
5+ "context"
56 "crypto/sha256"
67 "encoding/hex"
78 "encoding/json"
@@ -106,7 +107,7 @@ func TestIgnoreNodeAnnouncement(t *testing.T) {
106107 }
107108 copy (node .PubKeyBytes [:], pub .SerializeCompressed ())
108109
109- err := ctx .builder .AddNode (node )
110+ err := ctx .builder .AddNode (context . Background (), node )
110111 if ! IsError (err , ErrIgnored ) {
111112 t .Fatalf ("expected to get ErrIgnore, instead got: %v" , err )
112113 }
@@ -1068,7 +1069,7 @@ func TestIsStaleNode(t *testing.T) {
10681069 Features : testFeatures ,
10691070 }
10701071 copy (n1 .PubKeyBytes [:], priv1 .PubKey ().SerializeCompressed ())
1071- if err := ctx .builder .AddNode (n1 ); err != nil {
1072+ if err := ctx .builder .AddNode (context . Background (), n1 ); err != nil {
10721073 t .Fatalf ("could not add node: %v" , err )
10731074 }
10741075
@@ -1328,6 +1329,8 @@ func createTestCtxFromFile(t *testing.T,
13281329func parseTestGraph (t * testing.T , useCache bool , path string ) (
13291330 * testGraphInstance , error ) {
13301331
1332+ ctx := context .Background ()
1333+
13311334 graphJSON , err := os .ReadFile (path )
13321335 if err != nil {
13331336 return nil , err
@@ -1434,7 +1437,7 @@ func parseTestGraph(t *testing.T, useCache bool, path string) (
14341437
14351438 // With the node fully parsed, add it as a vertex within the
14361439 // graph.
1437- if err := graph .AddLightningNode (dbNode ); err != nil {
1440+ if err := graph .AddLightningNode (ctx , dbNode ); err != nil {
14381441 return nil , err
14391442 }
14401443 }
@@ -1715,6 +1718,8 @@ func createTestGraphFromChannels(t *testing.T, useCache bool,
17151718 testChannels []* testChannel , source string ) (* testGraphInstance ,
17161719 error ) {
17171720
1721+ ctx := context .Background ()
1722+
17181723 // We'll use this fake address for the IP address of all the nodes in
17191724 // our tests. This value isn't needed for path finding so it doesn't
17201725 // need to be unique.
@@ -1763,7 +1768,7 @@ func createTestGraphFromChannels(t *testing.T, useCache bool,
17631768
17641769 // With the node fully parsed, add it as a vertex within the
17651770 // graph.
1766- if err := graph .AddLightningNode (dbNode ); err != nil {
1771+ if err := graph .AddLightningNode (ctx , dbNode ); err != nil {
17671772 return nil , err
17681773 }
17691774
0 commit comments