Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itest: expect failure on direct rfq peer btc invoices #916

Open
wants to merge 2 commits into
base: update-to-lnd-18-4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee4e7ff52f83
github.com/lightninglabs/lightning-terminal/autopilotserverrpc v0.0.1
github.com/lightninglabs/lightning-terminal/litrpc v1.0.0
github.com/lightninglabs/lndclient v0.18.4-7
github.com/lightninglabs/lndclient v1.0.1-0.20241212185726-f8f7e3fa3ad8
github.com/lightninglabs/loop v0.28.9-beta.0.20241121150838-d198bb8230a8
github.com/lightninglabs/loop/looprpc v1.0.1
github.com/lightninglabs/loop/swapserverrpc v1.0.10
Expand Down Expand Up @@ -236,4 +236,8 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d

replace github.com/lightninglabs/lightning-terminal/litrpc => ./litrpc

replace github.com/lightninglabs/taproot-assets => github.com/GeorgeTsagk/taproot-assets v0.0.0-20241212125652-ffc6e682eff3

replace github.com/lightningnetwork/lnd => github.com/GeorgeTsagk/lnd v0.0.0-20241213100701-2c54b97abc30

go 1.22.6
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg6
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/GeorgeTsagk/lnd v0.0.0-20241213100701-2c54b97abc30 h1:B7Dt9wkUgYC1grXtLM8rljo76N2I5e6hU3yiIefM0m8=
github.com/GeorgeTsagk/lnd v0.0.0-20241213100701-2c54b97abc30/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
github.com/GeorgeTsagk/taproot-assets v0.0.0-20241212125652-ffc6e682eff3 h1:8E/DqiTB1tJ/Uyo7PwrJCZTRsh/4M5Zlpol7aXXWrbA=
github.com/GeorgeTsagk/taproot-assets v0.0.0-20241212125652-ffc6e682eff3/go.mod h1:rkSWHSkPXX2k+PBOkEE1BA3L3qq5+Yv3m6LGkoH3tQk=
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
Expand Down Expand Up @@ -1157,8 +1161,8 @@ github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee
github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee4e7ff52f83/go.mod h1:+SasPOt0evcJdfApb/ALTaTz4x3a2/kWy5KqFoTpiX8=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 h1:Er1miPZD2XZwcfE4xoS5AILqP1mj7kqnhbBSxW9BDxY=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4=
github.com/lightninglabs/lndclient v0.18.4-7 h1:3lV3jeaL66wtxFeR+7YTo+1ZJ8YzD3gYHG8U9yas3YM=
github.com/lightninglabs/lndclient v0.18.4-7/go.mod h1:qaIx+eqEV+Bdf1j7GVeJiDqJbtZXsr9XTfHu/8HmgQU=
github.com/lightninglabs/lndclient v1.0.1-0.20241212185726-f8f7e3fa3ad8 h1:aOa99sBtrwSvnAED/BVTVjRYY/KoUtltuQmTF2FARJg=
github.com/lightninglabs/lndclient v1.0.1-0.20241212185726-f8f7e3fa3ad8/go.mod h1:qaIx+eqEV+Bdf1j7GVeJiDqJbtZXsr9XTfHu/8HmgQU=
github.com/lightninglabs/loop v0.28.9-beta.0.20241121150838-d198bb8230a8 h1:8bZN2579/knq1/NnT7Y/LnVQFVbiLgXGmC3SetS/lf8=
github.com/lightninglabs/loop v0.28.9-beta.0.20241121150838-d198bb8230a8/go.mod h1:cNKUaGO5HwxbkOJ+JN3iGXOJe7SI5xZZkK+uutJqp5g=
github.com/lightninglabs/loop/looprpc v1.0.1 h1:r/Nj9A26T/rZkbmUg6AttkK9n5r4jR4Hul4OOCM/5t0=
Expand All @@ -1177,12 +1181,8 @@ github.com/lightninglabs/pool/poolrpc v1.0.0 h1:vvosrgNx9WXF4mcHGqLjZOW8wNM0q+BL
github.com/lightninglabs/pool/poolrpc v1.0.0/go.mod h1:ZqpEpBFRMMBAerMmilEjh27tqauSXDwLaLR0O3jvmMA=
github.com/lightninglabs/protobuf-go-hex-display v1.34.2-hex-display h1:w7FM5LH9Z6CpKxl13mS48idsu6F+cEZf0lkyiV+Dq9g=
github.com/lightninglabs/protobuf-go-hex-display v1.34.2-hex-display/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
github.com/lightninglabs/taproot-assets v0.5.0-rc2 h1:JJozESn+swnvi8ZR8WOaRzjHduVzlnhkw018jjQU2K4=
github.com/lightninglabs/taproot-assets v0.5.0-rc2/go.mod h1:rkSWHSkPXX2k+PBOkEE1BA3L3qq5+Yv3m6LGkoH3tQk=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
github.com/lightningnetwork/lnd v0.18.4-beta.rc2 h1:HJTccweV5i/0JM0C5flhjx+fKZg4EDIz4dhEs8ZWSQs=
github.com/lightningnetwork/lnd v0.18.4-beta.rc2/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
Expand Down
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, lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lll, here and below. Can use failureIncorrectDetails that's defined in assets_test.go instead.

)
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, lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS),
)
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 @@ -965,7 +961,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 @@ -1959,17 +1955,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
Loading