4949 }
5050
5151 shortTimeout = time .Second * 5
52-
53- defaultPaymentStatusOpt = fn .None [lnrpc.Payment_PaymentStatus ]()
5452)
5553
5654var (
@@ -272,8 +270,7 @@ func testCustomChannelsLarge(_ context.Context, net *NetworkHarness,
272270 fabiaInvoiceAssetAmount / 2
273271 sendAssetKeySendPayment (
274272 t .t , charlie , dave , charlieRemainingBalance ,
275- assetID , fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
276- fn .None [lnrpc.PaymentFailureReason ](),
273+ assetID , fn .None [int64 ](),
277274 )
278275 logBalance (t .t , nodes , assetID , "after keysend" )
279276
@@ -428,8 +425,7 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
428425 keySendAmount := charlieFundingAmount
429426 sendAssetKeySendPayment (
430427 t .t , charlie , dave , charlieFundingAmount , assetID ,
431- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
432- fn .None [lnrpc.PaymentFailureReason ](),
428+ fn .None [int64 ](),
433429 )
434430 logBalance (t .t , nodes , assetID , "after keysend" )
435431
@@ -473,8 +469,7 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
473469 // Let's keysend the rest of the balance back to Charlie.
474470 sendAssetKeySendPayment (
475471 t .t , dave , charlie , charlieFundingAmount - charlieInvoiceAmount ,
476- assetID , fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
477- fn .None [lnrpc.PaymentFailureReason ](),
472+ assetID , fn .None [int64 ](),
478473 )
479474 logBalance (t .t , nodes , assetID , "after keysend back" )
480475
@@ -527,7 +522,9 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
527522 t .t , charlie , dave , daveInvoiceAssetAmount , assetID ,
528523 )
529524 payInvoiceWithSatoshi (
530- t .t , charlie , invoiceResp , lnrpc .Payment_FAILED , false ,
525+ t .t , charlie , invoiceResp , withFailure (
526+ lnrpc .Payment_FAILED , failureIncorrectDetails ,
527+ ),
531528 )
532529 logBalance (t .t , nodes , assetID , "after asset invoice paid with sats" )
533530
@@ -574,9 +571,7 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
574571 invoiceResp = createAssetInvoice (
575572 t .t , erin , fabia , fabiaInvoiceAssetAmount2 , assetID ,
576573 )
577- payInvoiceWithSatoshi (
578- t .t , dave , invoiceResp , lnrpc .Payment_SUCCEEDED , false ,
579- )
574+ payInvoiceWithSatoshi (t .t , dave , invoiceResp )
580575 logBalance (t .t , nodes , assetID , "after invoice" )
581576
582577 erinAssetBalance -= fabiaInvoiceAssetAmount2
@@ -899,7 +894,6 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
899894 const keySendAmount = 100
900895 sendAssetKeySendPayment (
901896 t .t , charlie , dave , keySendAmount , assetID , fn .None [int64 ](),
902- lnrpc .Payment_SUCCEEDED , fn .None [lnrpc.PaymentFailureReason ](),
903897 )
904898 logBalance (t .t , nodes , assetID , "after keysend" )
905899
@@ -911,7 +905,6 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
911905 // an HTLC.
912906 sendAssetKeySendPayment (
913907 t .t , dave , charlie , keySendAmount , assetID , fn .None [int64 ](),
914- lnrpc .Payment_SUCCEEDED , fn .None [lnrpc.PaymentFailureReason ](),
915908 )
916909 logBalance (t .t , nodes , assetID , "after keysend back" )
917910
@@ -1008,9 +1001,7 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
10081001 invoiceResp = createAssetInvoice (
10091002 t .t , erin , fabia , fabiaInvoiceAssetAmount2 , assetID ,
10101003 )
1011- payInvoiceWithSatoshi (
1012- t .t , dave , invoiceResp , lnrpc .Payment_SUCCEEDED , false ,
1013- )
1004+ payInvoiceWithSatoshi (t .t , dave , invoiceResp )
10141005 logBalance (t .t , nodes , assetID , "after invoice" )
10151006
10161007 erinAssetBalance -= fabiaInvoiceAssetAmount2
@@ -1322,8 +1313,7 @@ func testCustomChannelsForceClose(_ context.Context, net *NetworkHarness,
13221313 for i := 0 ; i < numPayments ; i ++ {
13231314 sendAssetKeySendPayment (
13241315 t .t , charlie , dave , keySendAmount , assetID ,
1325- fn .Some (btcAmt ), lnrpc .Payment_SUCCEEDED ,
1326- fn .None [lnrpc.PaymentFailureReason ](),
1316+ fn .Some (btcAmt ),
13271317 )
13281318 }
13291319
@@ -1652,8 +1642,7 @@ func testCustomChannelsBreach(_ context.Context, net *NetworkHarness,
16521642 for i := 0 ; i < numPayments ; i ++ {
16531643 sendAssetKeySendPayment (
16541644 t .t , charlie , dave , keySendAmount , assetID ,
1655- fn .Some (btcAmt ), lnrpc .Payment_SUCCEEDED ,
1656- fn .None [lnrpc.PaymentFailureReason ](),
1645+ fn .Some (btcAmt ),
16571646 )
16581647 }
16591648
@@ -1668,8 +1657,6 @@ func testCustomChannelsBreach(_ context.Context, net *NetworkHarness,
16681657 // just at above.
16691658 sendAssetKeySendPayment (
16701659 t .t , charlie , dave , keySendAmount , assetID , fn .Some (btcAmt ),
1671- lnrpc .Payment_SUCCEEDED ,
1672- fn .None [lnrpc.PaymentFailureReason ](),
16731660 )
16741661 logBalance (t .t , nodes , assetID , "after keysend -- final state" )
16751662
@@ -1866,9 +1853,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
18661853 // Normal case.
18671854 // Send 50 assets from Charlie to Dave.
18681855 sendAssetKeySendPayment (
1869- t .t , charlie , dave , 50 , assetID ,
1870- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
1871- fn .None [lnrpc.PaymentFailureReason ](),
1856+ t .t , charlie , dave , 50 , assetID , fn .None [int64 ](),
18721857 )
18731858
18741859 logBalance (t .t , nodes , assetID , "after 50 assets" )
@@ -1891,12 +1876,10 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
18911876 timeoutChan := time .After (PaymentTimeout / 2 )
18921877 done := make (chan bool , 1 )
18931878
1894- //nolint:lll
18951879 go func () {
18961880 sendAssetKeySendPayment (
1897- t .t , dave , charlie , 50 , assetID ,
1898- fn .None [int64 ](), lnrpc .Payment_FAILED ,
1899- fn .Some (lnrpc .PaymentFailureReason_FAILURE_REASON_NO_ROUTE ),
1881+ t .t , dave , charlie , 50 , assetID , fn .None [int64 ](),
1882+ withFailure (lnrpc .Payment_FAILED , failureNoRoute ),
19001883 )
19011884
19021885 done <- true
@@ -1918,9 +1901,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
19181901 // Now Dave tries to send 50 assets again, this time he should have
19191902 // enough sats.
19201903 sendAssetKeySendPayment (
1921- t .t , dave , charlie , 50 , assetID ,
1922- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
1923- fn .None [lnrpc.PaymentFailureReason ](),
1904+ t .t , dave , charlie , 50 , assetID , fn .None [int64 ](),
19241905 )
19251906
19261907 logBalance (t .t , nodes , assetID , "after 50 sats backwards" )
@@ -1990,9 +1971,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
19901971
19911972 // Dave sends 200k assets and 5k sats to Yara.
19921973 sendAssetKeySendPayment (
1993- t .t , dave , yara , 2 * bigAssetAmount , assetID ,
1994- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
1995- fn .None [lnrpc.PaymentFailureReason ](),
1974+ t .t , dave , yara , 2 * bigAssetAmount , assetID , fn .None [int64 ](),
19961975 )
19971976 sendKeySendPayment (t .t , dave , yara , 5_000 )
19981977
@@ -2018,9 +1997,9 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
20181997 // channels, where the total asset value is less than the default anchor
20191998 // amount of 354 sats.
20201999 invoiceResp = createAssetInvoice (t .t , dave , charlie , 1 , assetID )
2021- payInvoiceWithSatoshi (
2022- t . t , yara , invoiceResp , lnrpc .Payment_FAILED , false ,
2023- )
2000+ payInvoiceWithSatoshi (t . t , yara , invoiceResp , withFailure (
2001+ lnrpc .Payment_FAILED , failureNoRoute ,
2002+ ))
20242003
20252004 logBalance (t .t , nodes , assetID , "after small payment (asset " +
20262005 "invoice, <354sats)" )
@@ -2060,9 +2039,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
20602039
20612040 // We start by sloshing some funds in the Erin<->Fabia.
20622041 sendAssetKeySendPayment (
2063- t .t , erin , fabia , 100_000 , assetID ,
2064- fn.Some [int64 ](20_000 ), lnrpc .Payment_SUCCEEDED ,
2065- fn .None [lnrpc.PaymentFailureReason ](),
2042+ t .t , erin , fabia , 100_000 , assetID , fn.Some [int64 ](20_000 ),
20662043 )
20672044
20682045 logBalance (t .t , nodes , assetID , "balance after 1st slosh" )
@@ -2188,7 +2165,10 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
21882165
21892166 // Now Erin tries to pay the invoice. Since rfq quote cannot satisfy the
21902167 // total amount of the invoice this payment will fail.
2191- payInvoiceWithSatoshi (t .t , erin , iResp , lnrpc .Payment_FAILED , true )
2168+ payInvoiceWithSatoshi (
2169+ t .t , erin , iResp , withExpectTimeout (),
2170+ withFailure (lnrpc .Payment_FAILED , failureNone ),
2171+ )
21922172
21932173 logBalance (t .t , nodes , assetID , "after small manual rfq" )
21942174}
@@ -2333,9 +2313,7 @@ func testCustomChannelsBalanceConsistency(_ context.Context,
23332313 // Normal case.
23342314 // Send 500 assets from Charlie to Dave.
23352315 sendAssetKeySendPayment (
2336- t .t , charlie , dave , 500 , assetID ,
2337- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
2338- fn .None [lnrpc.PaymentFailureReason ](),
2316+ t .t , charlie , dave , 500 , assetID , fn .None [int64 ](),
23392317 )
23402318
23412319 logBalance (t .t , nodes , assetID , "after 500 assets" )
@@ -2351,9 +2329,7 @@ func testCustomChannelsBalanceConsistency(_ context.Context,
23512329
23522330 // Now Dave tries to send 250 assets.
23532331 sendAssetKeySendPayment (
2354- t .t , dave , charlie , 250 , assetID ,
2355- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
2356- fn .None [lnrpc.PaymentFailureReason ](),
2332+ t .t , dave , charlie , 250 , assetID , fn .None [int64 ](),
23572333 )
23582334
23592335 logBalance (t .t , nodes , assetID , "after 250 sats backwards" )
@@ -3012,8 +2988,7 @@ func runCustomChannelsHtlcForceClose(ctxb context.Context, t *harnessTest,
30122988 for i := 0 ; i < numPayments ; i ++ {
30132989 sendAssetKeySendPayment (
30142990 t .t , alice , bob , keySendAmount , assetID ,
3015- fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
3016- fn .None [lnrpc.PaymentFailureReason ](),
2991+ fn .None [int64 ](),
30172992 )
30182993 }
30192994
0 commit comments