@@ -495,7 +495,9 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
495495
496496 // Calling DeleteFailedAttempts on a failed payment should delete all
497497 // HTLCs.
498- require .NoError (t , paymentDB .DeleteFailedAttempts (payments [0 ].id ))
498+ require .NoError (t , paymentDB .DeleteFailedAttempts (
499+ t .Context (), payments [0 ].id ,
500+ ))
499501
500502 // Expect all HTLCs to be deleted if the config is set to delete them.
501503 if ! keepFailedPaymentAttempts {
@@ -510,19 +512,25 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
510512 // operation are performed in general therefore we do NOT expect an
511513 // error in this case.
512514 if keepFailedPaymentAttempts {
513- require . NoError ( t , paymentDB .DeleteFailedAttempts (
514- payments [1 ].id ) ,
515+ err := paymentDB .DeleteFailedAttempts (
516+ t . Context (), payments [1 ].id ,
515517 )
518+ require .NoError (t , err )
516519 } else {
517- require .Error (t , paymentDB .DeleteFailedAttempts (payments [1 ].id ))
520+ err := paymentDB .DeleteFailedAttempts (
521+ t .Context (), payments [1 ].id ,
522+ )
523+ require .Error (t , err )
518524 }
519525
520526 // Since DeleteFailedAttempts returned an error, we should expect the
521527 // payment to be unchanged.
522528 assertDBPayments (t , paymentDB , payments )
523529
524530 // Cleaning up a successful payment should remove failed htlcs.
525- require .NoError (t , paymentDB .DeleteFailedAttempts (payments [2 ].id ))
531+ require .NoError (t , paymentDB .DeleteFailedAttempts (
532+ t .Context (), payments [2 ].id ,
533+ ))
526534
527535 // Expect all HTLCs except for the settled one to be deleted if the
528536 // config is set to delete them.
@@ -539,13 +547,17 @@ func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
539547 // payments, if the control tower is configured to keep failed
540548 // HTLCs.
541549 require .NoError (
542- t , paymentDB .DeleteFailedAttempts (lntypes .ZeroHash ),
550+ t , paymentDB .DeleteFailedAttempts (
551+ t .Context (), lntypes .ZeroHash ,
552+ ),
543553 )
544554 } else {
545555 // Attempting to cleanup a non-existent payment returns an
546556 // error.
547557 require .Error (
548- t , paymentDB .DeleteFailedAttempts (lntypes .ZeroHash ),
558+ t , paymentDB .DeleteFailedAttempts (
559+ t .Context (), lntypes .ZeroHash ,
560+ ),
549561 )
550562 }
551563}
0 commit comments