@@ -2675,8 +2675,8 @@ func testCustomChannelsLiquidityEdgeCasesCore(ctx context.Context,
2675
2675
logBalance (t .t , nodes , assetID , "after manual rfq hodl" )
2676
2676
2677
2677
// Edge case: Charlie negotiates a quote with Dave which has a low max
2678
- // amount (~170k sats). Then Charlie creates an invoice with a total
2679
- // amount slightly larger than the max allowed in the quote (200k sats).
2678
+ // amount (~17k sats). Then Charlie creates an invoice with a total
2679
+ // amount slightly larger than the max allowed in the quote (30k sats).
2680
2680
// Erin will try to pay that invoice with sats, in shards of max size
2681
2681
// 80k sats. Dave will eventually stop forwarding HTLCs as the RFQ HTLC
2682
2682
// tracking mechanism should stop them from being forwarded, as they
@@ -2687,7 +2687,7 @@ func testCustomChannelsLiquidityEdgeCasesCore(ctx context.Context,
2687
2687
res , err := charlieTap .RfqClient .AddAssetBuyOrder (
2688
2688
ctx , & rfqrpc.AddAssetBuyOrderRequest {
2689
2689
AssetSpecifier : & assetSpecifier ,
2690
- AssetMaxAmt : 10_000 ,
2690
+ AssetMaxAmt : 1_000 ,
2691
2691
Expiry : uint64 (inOneHour .Unix ()),
2692
2692
PeerPubKey : dave .PubKey [:],
2693
2693
TimeoutSeconds : 10 ,
@@ -2703,7 +2703,7 @@ func testCustomChannelsLiquidityEdgeCasesCore(ctx context.Context,
2703
2703
// manually generated, quote.
2704
2704
iResp , err := charlie .AddInvoice (ctx , & lnrpc.Invoice {
2705
2705
Memo : "" ,
2706
- Value : 200_000 ,
2706
+ Value : 30_000 ,
2707
2707
RPreimage : bytes .Repeat ([]byte {11 }, 32 ),
2708
2708
CltvExpiry : 60 ,
2709
2709
RouteHints : []* lnrpc.RouteHint {{
@@ -2718,11 +2718,22 @@ func testCustomChannelsLiquidityEdgeCasesCore(ctx context.Context,
2718
2718
// Now Erin tries to pay the invoice. Since rfq quote cannot satisfy the
2719
2719
// total amount of the invoice this payment will fail.
2720
2720
payInvoiceWithSatoshi (
2721
- t .t , erin , iResp , withPayErrSubStr ( "context deadline exceeded" ),
2722
- withFailure (lnrpc .Payment_FAILED , failureNone ),
2723
- withGroupKey (groupID ),
2721
+ t .t , erin , iResp ,
2722
+ withFailure (lnrpc .Payment_FAILED , failureNoRoute ),
2723
+ withGroupKey (groupID ), withSmallShards (),
2724
2724
)
2725
2725
2726
+ // Let's also cancel the invoice and assert that no HTLCs are still
2727
+ // in-flight.
2728
+ _ , err = charlie .InvoicesClient .CancelInvoice (
2729
+ ctx , & invoicesrpc.CancelInvoiceMsg {
2730
+ PaymentHash : iResp .RHash ,
2731
+ },
2732
+ )
2733
+ require .NoError (t .t , err )
2734
+
2735
+ assertNumHtlcs (t .t , dave , 0 )
2736
+
2726
2737
logBalance (t .t , nodes , assetID , "after small manual rfq" )
2727
2738
2728
2739
// Edge case: Fabia creates an invoice which Erin cannot satisfy with
0 commit comments