@@ -324,7 +324,9 @@ func TestSendPaymentRouteFailureFallback(t *testing.T) {
324324
325325 // Send off the payment request to the router, route through pham nuwen
326326 // should've been selected as a fall back and succeeded correctly.
327- paymentPreImage , route , err := ctx .router .SendPayment (payment )
327+ paymentPreImage , route , err := ctx .router .SendPayment (
328+ t .Context (), payment ,
329+ )
328330 require .NoErrorf (t , err , "unable to send payment: %v" ,
329331 payment .paymentHash )
330332
@@ -403,7 +405,9 @@ func TestSendPaymentRouteInfiniteLoopWithBadHopHint(t *testing.T) {
403405
404406 // Send off the payment request to the router, should succeed
405407 // ignoring the bad channel id hint.
406- paymentPreImage , route , paymentErr := ctx .router .SendPayment (payment )
408+ paymentPreImage , route , paymentErr := ctx .router .SendPayment (
409+ t .Context (), payment ,
410+ )
407411 require .NoErrorf (t , paymentErr , "unable to send payment: %v" ,
408412 payment .paymentHash )
409413
@@ -634,7 +638,9 @@ func TestSendPaymentErrorRepeatedFeeInsufficient(t *testing.T) {
634638
635639 // Send off the payment request to the router, route through phamnuwen
636640 // should've been selected as a fall back and succeeded correctly.
637- paymentPreImage , route , err := ctx .router .SendPayment (payment )
641+ paymentPreImage , route , err := ctx .router .SendPayment (
642+ t .Context (), payment ,
643+ )
638644 require .NoErrorf (t , err , "unable to send payment: %v" ,
639645 payment .paymentHash )
640646
@@ -741,7 +747,9 @@ func TestSendPaymentErrorFeeInsufficientPrivateEdge(t *testing.T) {
741747
742748 // Send off the payment request to the router, route through son
743749 // goku and then across the private channel to elst.
744- paymentPreImage , route , err := ctx .router .SendPayment (payment )
750+ paymentPreImage , route , err := ctx .router .SendPayment (
751+ t .Context (), payment ,
752+ )
745753 require .NoErrorf (t , err , "unable to send payment: %v" ,
746754 payment .paymentHash )
747755
@@ -867,7 +875,9 @@ func TestSendPaymentPrivateEdgeUpdateFeeExceedsLimit(t *testing.T) {
867875
868876 // Send off the payment request to the router, route through son
869877 // goku and then across the private channel to elst.
870- paymentPreImage , route , err := ctx .router .SendPayment (payment )
878+ paymentPreImage , route , err := ctx .router .SendPayment (
879+ t .Context (), payment ,
880+ )
871881 require .NoErrorf (t , err , "unable to send payment: %v" ,
872882 payment .paymentHash )
873883
@@ -990,7 +1000,9 @@ func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) {
9901000 // Send off the payment request to the router, this payment should
9911001 // succeed as we should actually go through Pham Nuwen in order to get
9921002 // to Sophon, even though he has higher fees.
993- paymentPreImage , rt , err := ctx .router .SendPayment (payment )
1003+ paymentPreImage , rt , err := ctx .router .SendPayment (
1004+ t .Context (), payment ,
1005+ )
9941006 require .NoErrorf (t , err , "unable to send payment: %v" ,
9951007 payment .paymentHash )
9961008
@@ -1016,7 +1028,9 @@ func TestSendPaymentErrorNonFinalTimeLockErrors(t *testing.T) {
10161028 // w.r.t to the block height, and instead go through Pham Nuwen. We
10171029 // flip a bit in the payment hash to allow resending this payment.
10181030 payment .paymentHash [1 ] ^= 1
1019- paymentPreImage , rt , err = ctx .router .SendPayment (payment )
1031+ paymentPreImage , rt , err = ctx .router .SendPayment (
1032+ t .Context (), payment ,
1033+ )
10201034 require .NoErrorf (t , err , "unable to send payment: %v" ,
10211035 payment .paymentHash )
10221036
@@ -1085,7 +1099,7 @@ func TestSendPaymentErrorPathPruning(t *testing.T) {
10851099
10861100 // When we try to dispatch that payment, we should receive an error as
10871101 // both attempts should fail and cause both routes to be pruned.
1088- _ , _ , err = ctx .router .SendPayment (payment )
1102+ _ , _ , err = ctx .router .SendPayment (t . Context (), payment )
10891103 require .Error (t , err , "payment didn't return error" )
10901104
10911105 // The final error returned should also indicate that the peer wasn't
@@ -1130,7 +1144,9 @@ func TestSendPaymentErrorPathPruning(t *testing.T) {
11301144 // This shouldn't return an error, as we'll make a payment attempt via
11311145 // the pham nuwen channel based on the assumption that there might be an
11321146 // intermittent issue with the songoku <-> sophon channel.
1133- paymentPreImage , rt , err := ctx .router .SendPayment (payment )
1147+ paymentPreImage , rt , err := ctx .router .SendPayment (
1148+ t .Context (), payment ,
1149+ )
11341150 require .NoErrorf (t , err , "unable to send payment: %v" ,
11351151 payment .paymentHash )
11361152
@@ -1170,7 +1186,9 @@ func TestSendPaymentErrorPathPruning(t *testing.T) {
11701186
11711187 // We flip a bit in the payment hash to allow resending this payment.
11721188 payment .paymentHash [1 ] ^= 1
1173- paymentPreImage , rt , err = ctx .router .SendPayment (payment )
1189+ paymentPreImage , rt , err = ctx .router .SendPayment (
1190+ t .Context (), payment ,
1191+ )
11741192 require .NoErrorf (t , err , "unable to send payment: %v" ,
11751193 payment .paymentHash )
11761194
@@ -1302,7 +1320,7 @@ func TestUnknownErrorSource(t *testing.T) {
13021320 // the route a->b->c is tried first. An unreadable faiure is returned
13031321 // which should pruning the channel a->b. We expect the payment to
13041322 // succeed via a->d.
1305- _ , _ , err = ctx .router .SendPayment (payment )
1323+ _ , _ , err = ctx .router .SendPayment (t . Context (), payment )
13061324 require .NoErrorf (t , err , "unable to send payment: %v" ,
13071325 payment .paymentHash )
13081326
@@ -1327,7 +1345,7 @@ func TestUnknownErrorSource(t *testing.T) {
13271345 // Send off the payment request to the router. We expect the payment to
13281346 // fail because both routes have been pruned.
13291347 payment .paymentHash [1 ] ^= 1
1330- _ , _ , err = ctx .router .SendPayment (payment )
1348+ _ , _ , err = ctx .router .SendPayment (t . Context (), payment )
13311349 if err == nil {
13321350 t .Fatalf ("expected payment to fail" )
13331351 }
0 commit comments