Skip to content

Commit ec7a3e6

Browse files
committed
itest: expect failure on direct rfq peer btc invoice
Previously we'd consider it acceptable to settle direct rfq peer invoices, which included no rfq scid, with asset HTLCs. This behavior has been updated on the tapd invoice manager and we no longer accept asset HTLCs on invoices that do not expect assets. This commit updates such payments in our itests to instead expect a failure.
1 parent 868d058 commit ec7a3e6

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

itest/litd_custom_channels_test.go

+6-21
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,12 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
482482
// a direct channel invoice payment with no RFQ SCID present in the
483483
// invoice.
484484
// ------------
485-
paidAssetAmount := createAndPayNormalInvoice(
485+
createAndPayNormalInvoice(
486486
t.t, charlie, dave, dave, 20_000, assetID, withSmallShards(),
487+
withFailure(lnrpc.Payment_FAILED, failureIncorrectDetails),
487488
)
488489
logBalance(t.t, nodes, assetID, "after invoice")
489490

490-
charlieAssetBalance -= paidAssetAmount
491-
daveAssetBalance += paidAssetAmount
492-
493491
// We should also be able to do a multi-hop BTC only payment, paying an
494492
// invoice from Erin by Charlie.
495493
createAndPayNormalInvoiceWithBtc(t.t, charlie, erin, 2000)
@@ -535,7 +533,7 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
535533
// ------------
536534
// Test case 4: Pay a normal invoice from Erin by Charlie.
537535
// ------------
538-
paidAssetAmount = createAndPayNormalInvoice(
536+
paidAssetAmount := createAndPayNormalInvoice(
539537
t.t, charlie, dave, erin, 20_000, assetID, withSmallShards(),
540538
)
541539
logBalance(t.t, nodes, assetID, "after invoice")
@@ -921,14 +919,12 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
921919
// a direct channel invoice payment with no RFQ SCID present in the
922920
// invoice.
923921
// ------------
924-
paidAssetAmount := createAndPayNormalInvoice(
922+
createAndPayNormalInvoice(
925923
t.t, charlie, dave, dave, 20_000, assetID, withSmallShards(),
924+
withFailure(lnrpc.Payment_FAILED, failureIncorrectDetails),
926925
)
927926
logBalance(t.t, nodes, assetID, "after invoice")
928927

929-
charlieAssetBalance -= paidAssetAmount
930-
daveAssetBalance += paidAssetAmount
931-
932928
// We should also be able to do a multi-hop BTC only payment, paying an
933929
// invoice from Erin by Charlie.
934930
createAndPayNormalInvoiceWithBtc(t.t, charlie, erin, 2000)
@@ -966,7 +962,7 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
966962
// ------------
967963
// Test case 4: Pay a normal invoice from Erin by Charlie.
968964
// ------------
969-
paidAssetAmount = createAndPayNormalInvoice(
965+
paidAssetAmount := createAndPayNormalInvoice(
970966
t.t, charlie, dave, erin, 20_000, assetID, withSmallShards(),
971967
)
972968
logBalance(t.t, nodes, assetID, "after invoice")
@@ -1960,17 +1956,6 @@ func testCustomChannelsLiquidityEdgeCases(ctxb context.Context,
19601956
t.t, charlie, invoiceResp.RHash, assetID, bigAssetAmount,
19611957
)
19621958

1963-
// Edge case: Big normal invoice, paid by direct channel peer with
1964-
// assets.
1965-
const hugeAssetAmount = 1_000_000
1966-
_ = createAndPayNormalInvoice(
1967-
t.t, dave, charlie, charlie, hugeAssetAmount, assetID,
1968-
withSmallShards(),
1969-
)
1970-
1971-
logBalance(t.t, nodes, assetID, "after big asset payment (btc "+
1972-
"invoice, direct)")
1973-
19741959
// Dave sends 200k assets and 5k sats to Yara.
19751960
sendAssetKeySendPayment(
19761961
t.t, dave, yara, 2*bigAssetAmount, assetID, fn.None[int64](),

0 commit comments

Comments
 (0)