From 76e65f1c32e81197acf1ccce4010b6f546ce3cee Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Wed, 11 Dec 2024 12:07:48 +0100 Subject: [PATCH] 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. --- itest/litd_custom_channels_test.go | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/itest/litd_custom_channels_test.go b/itest/litd_custom_channels_test.go index 77789c496..bfb810017 100644 --- a/itest/litd_custom_channels_test.go +++ b/itest/litd_custom_channels_test.go @@ -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) @@ -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") @@ -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) @@ -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") @@ -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](),