@@ -503,7 +503,9 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
503503
504504 // Calling DeleteFailedAttempts on a failed payment should delete all
505505 // HTLCs.
506- require .NoError (t , paymentDB .DeleteFailedAttempts (payments [0 ].id ))
506+ require .NoError (t , paymentDB .DeleteFailedAttempts (
507+ t .Context (), payments [0 ].id ,
508+ ))
507509
508510 // Expect all HTLCs to be deleted if the config is set to delete them.
509511 if ! keepFailedPaymentAttempts {
@@ -518,19 +520,25 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
518520 // operation are performed in general therefore we do NOT expect an
519521 // error in this case.
520522 if keepFailedPaymentAttempts {
521- require . NoError ( t , paymentDB .DeleteFailedAttempts (
522- payments [1 ].id ) ,
523+ err := paymentDB .DeleteFailedAttempts (
524+ t . Context (), payments [1 ].id ,
523525 )
526+ require .NoError (t , err )
524527 } else {
525- require .Error (t , paymentDB .DeleteFailedAttempts (payments [1 ].id ))
528+ err := paymentDB .DeleteFailedAttempts (
529+ t .Context (), payments [1 ].id ,
530+ )
531+ require .Error (t , err )
526532 }
527533
528534 // Since DeleteFailedAttempts returned an error, we should expect the
529535 // payment to be unchanged.
530536 assertDBPayments (t , paymentDB , payments )
531537
532538 // Cleaning up a successful payment should remove failed htlcs.
533- require .NoError (t , paymentDB .DeleteFailedAttempts (payments [2 ].id ))
539+ require .NoError (t , paymentDB .DeleteFailedAttempts (
540+ t .Context (), payments [2 ].id ,
541+ ))
534542
535543 // Expect all HTLCs except for the settled one to be deleted if the
536544 // config is set to delete them.
@@ -547,13 +555,17 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
547555 // payments, if the control tower is configured to keep failed
548556 // HTLCs.
549557 require .NoError (
550- t , paymentDB .DeleteFailedAttempts (lntypes .ZeroHash ),
558+ t , paymentDB .DeleteFailedAttempts (
559+ t .Context (), lntypes .ZeroHash ,
560+ ),
551561 )
552562 } else {
553563 // Attempting to cleanup a non-existent payment returns an
554564 // error.
555565 require .Error (
556- t , paymentDB .DeleteFailedAttempts (lntypes .ZeroHash ),
566+ t , paymentDB .DeleteFailedAttempts (
567+ t .Context (), lntypes .ZeroHash ,
568+ ),
557569 )
558570 }
559571}
0 commit comments