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