Skip to content

Commit

Permalink
itest: expect failure on direct rfq peer btc invoice
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GeorgeTsagk authored and guggero committed Dec 16, 2024
1 parent 6bd6ace commit 76e65f1
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions itest/litd_custom_channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,12 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
// a direct channel invoice payment with no RFQ SCID present in the
// invoice.
// ------------
paidAssetAmount := createAndPayNormalInvoice(
createAndPayNormalInvoice(
t.t, charlie, dave, dave, 20_000, assetID, withSmallShards(),
withFailure(lnrpc.Payment_FAILED, failureIncorrectDetails),
)
logBalance(t.t, nodes, assetID, "after invoice")

charlieAssetBalance -= paidAssetAmount
daveAssetBalance += paidAssetAmount

// We should also be able to do a multi-hop BTC only payment, paying an
// invoice from Erin by Charlie.
createAndPayNormalInvoiceWithBtc(t.t, charlie, erin, 2000)
Expand Down Expand Up @@ -535,7 +533,7 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
// ------------
// Test case 4: Pay a normal invoice from Erin by Charlie.
// ------------
paidAssetAmount = createAndPayNormalInvoice(
paidAssetAmount := createAndPayNormalInvoice(
t.t, charlie, dave, erin, 20_000, assetID, withSmallShards(),
)
logBalance(t.t, nodes, assetID, "after invoice")
Expand Down Expand Up @@ -921,14 +919,12 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
// a direct channel invoice payment with no RFQ SCID present in the
// invoice.
// ------------
paidAssetAmount := createAndPayNormalInvoice(
createAndPayNormalInvoice(
t.t, charlie, dave, dave, 20_000, assetID, withSmallShards(),
withFailure(lnrpc.Payment_FAILED, failureIncorrectDetails),
)
logBalance(t.t, nodes, assetID, "after invoice")

charlieAssetBalance -= paidAssetAmount
daveAssetBalance += paidAssetAmount

// We should also be able to do a multi-hop BTC only payment, paying an
// invoice from Erin by Charlie.
createAndPayNormalInvoiceWithBtc(t.t, charlie, erin, 2000)
Expand Down Expand Up @@ -966,7 +962,7 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
// ------------
// Test case 4: Pay a normal invoice from Erin by Charlie.
// ------------
paidAssetAmount = createAndPayNormalInvoice(
paidAssetAmount := createAndPayNormalInvoice(
t.t, charlie, dave, erin, 20_000, assetID, withSmallShards(),
)
logBalance(t.t, nodes, assetID, "after invoice")
Expand Down Expand Up @@ -1960,17 +1956,6 @@ func testCustomChannelsLiquidityEdgeCases(ctxb context.Context,
t.t, charlie, invoiceResp.RHash, assetID, bigAssetAmount,
)

// Edge case: Big normal invoice, paid by direct channel peer with
// assets.
const hugeAssetAmount = 1_000_000
_ = createAndPayNormalInvoice(
t.t, dave, charlie, charlie, hugeAssetAmount, assetID,
withSmallShards(),
)

logBalance(t.t, nodes, assetID, "after big asset payment (btc "+
"invoice, direct)")

// Dave sends 200k assets and 5k sats to Yara.
sendAssetKeySendPayment(
t.t, dave, yara, 2*bigAssetAmount, assetID, fn.None[int64](),
Expand Down

0 comments on commit 76e65f1

Please sign in to comment.