diff --git a/go.mod b/go.mod index 7e3d7fa6e..db27b7682 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/lightninglabs/loop/swapserverrpc v1.0.8 github.com/lightninglabs/pool v0.6.5-beta.0.20240604070222-e121aadb3289 github.com/lightninglabs/pool/auctioneerrpc v1.1.2 - github.com/lightninglabs/taproot-assets v0.4.0-rc4 + github.com/lightninglabs/taproot-assets v0.4.0-rc4.0.20240716183814-7647ba8f48d5 github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240712025014-90f997c908d0 github.com/lightningnetwork/lnd/cert v1.2.2 github.com/lightningnetwork/lnd/fn v1.1.0 diff --git a/go.sum b/go.sum index 2c9b347e2..77e01e621 100644 --- a/go.sum +++ b/go.sum @@ -1175,8 +1175,8 @@ github.com/lightninglabs/pool/auctioneerrpc v1.1.2 h1:Dbg+9Z9jXnhimR27EN37foc4aB github.com/lightninglabs/pool/auctioneerrpc v1.1.2/go.mod h1:1wKDzN2zEP8srOi0B9iySlEsPdoPhw6oo3Vbm1v4Mhw= github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display h1:pRdza2wleRN1L2fJXd6ZoQ9ZegVFTAb2bOQfruJPKcY= github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -github.com/lightninglabs/taproot-assets v0.4.0-rc4 h1:tl8gClGZBmLlkMxfDRVAdIhx+LyhThZCEjYBpuM37pc= -github.com/lightninglabs/taproot-assets v0.4.0-rc4/go.mod h1:oAiEnRj2sCbPHAURot+tmKbyDhIoxnvkmag0JqlF1bs= +github.com/lightninglabs/taproot-assets v0.4.0-rc4.0.20240716183814-7647ba8f48d5 h1:+d5HMOuBUWMsUVx6tAzy7+g8m4A76tec5/FOb1w5iVs= +github.com/lightninglabs/taproot-assets v0.4.0-rc4.0.20240716183814-7647ba8f48d5/go.mod h1:oAiEnRj2sCbPHAURot+tmKbyDhIoxnvkmag0JqlF1bs= github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f h1:Pua7+5TcFEJXIIZ1I2YAUapmbcttmLj4TTi786bIi3s= github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI= github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20240712025014-90f997c908d0 h1:V+PoltFSxN5oijkErYe+QbnVz5WJjBsAzaMNRrhmz3Q= diff --git a/itest/litd_custom_channels_test.go b/itest/litd_custom_channels_test.go index 640326804..9904c2919 100644 --- a/itest/litd_custom_channels_test.go +++ b/itest/litd_custom_channels_test.go @@ -369,32 +369,50 @@ func testCustomChannels(_ context.Context, net *NetworkHarness, logBalance(t.t, nodes, assetID, "initial") // ------------ - // Test case 1: Send a direct keysend payment from Charlie to Dave. + // Test case 1: Send a direct keysend payment from Charlie to Dave, + // sending the whole balance. // ------------ - const keySendAmount = 1000 + keySendAmount := charlieFundingAmount sendAssetKeySendPayment( - t.t, charlie, dave, keySendAmount, assetID, fn.None[int64](), + t.t, charlie, dave, charlieFundingAmount, assetID, + fn.None[int64](), ) logBalance(t.t, nodes, assetID, "after keysend") charlieAssetBalance -= keySendAmount daveAssetBalance += keySendAmount - // We should be able to send the 1000 assets back immediately, because + // We should be able to send 1000 assets back immediately, because // there is enough on-chain balance on Dave's side to be able to create // an HTLC. We use an invoice to execute another code path. + const charlieInvoiceAmount = 1_000 invoiceResp := createAssetInvoice( - t.t, dave, charlie, keySendAmount, assetID, + t.t, dave, charlie, charlieInvoiceAmount, assetID, ) payInvoiceWithAssets(t.t, dave, charlie, invoiceResp, assetID, true) + logBalance(t.t, nodes, assetID, "after invoice back") - charlieAssetBalance += keySendAmount - daveAssetBalance -= keySendAmount + charlieAssetBalance += charlieInvoiceAmount + daveAssetBalance -= charlieInvoiceAmount - // We should also be able to do a non-asset (BTC only) keysend payment. + // We should also be able to do a non-asset (BTC only) keysend payment + // from Charlie to Dave. This'll also replenish the BTC balance of + // Dave, making it possible to send another asset HTLC below, sending + // all assets back to Charlie (so we have enough balance for further + // tests). sendKeySendPayment(t.t, charlie, dave, 2000, nil) logBalance(t.t, nodes, assetID, "after BTC only keysend") + // Let's keysend the rest of the balance back to Charlie. + sendAssetKeySendPayment( + t.t, dave, charlie, charlieFundingAmount-charlieInvoiceAmount, + assetID, fn.None[int64](), + ) + logBalance(t.t, nodes, assetID, "after keysend back") + + charlieAssetBalance += charlieFundingAmount - charlieInvoiceAmount + daveAssetBalance -= charlieFundingAmount - charlieInvoiceAmount + // ------------ // Test case 2: Pay a normal invoice from Dave by Charlie, making it // a direct channel invoice payment with no RFQ SCID present in the