Skip to content
Merged
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ require (
github.com/lightninglabs/pool v0.6.5-beta.0.20250305125211-4e860ec4e77f
github.com/lightninglabs/pool/auctioneerrpc v1.1.3-0.20250305125211-4e860ec4e77f
github.com/lightninglabs/pool/poolrpc v1.0.1-0.20250305125211-4e860ec4e77f
github.com/lightninglabs/taproot-assets v0.5.2-0.20250506181734-e63f1a4f4597
github.com/lightninglabs/taproot-assets/taprpc v1.0.1
github.com/lightninglabs/taproot-assets v0.5.2-0.20250508000445-bb5a2a6f154a
github.com/lightninglabs/taproot-assets/taprpc v1.0.2
github.com/lightningnetwork/lnd v0.19.0-beta.rc3
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ github.com/lightninglabs/pool/poolrpc v1.0.1-0.20250305125211-4e860ec4e77f h1:5p
github.com/lightninglabs/pool/poolrpc v1.0.1-0.20250305125211-4e860ec4e77f/go.mod h1:lGs2hSVZ+GFpdv3btaIl9icG5/gz7BBRfvmD2iqqNl0=
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.2-0.20250506181734-e63f1a4f4597 h1:2gdwdH9HAPWnHk/1gnU7g1imofiw56KAEuLVBmMeoyQ=
github.com/lightninglabs/taproot-assets v0.5.2-0.20250506181734-e63f1a4f4597/go.mod h1:OdeFcj2bnJf6aaYjBB5c8KdNI3aDaEMQpsSu2EqvMlw=
github.com/lightninglabs/taproot-assets/taprpc v1.0.1 h1:aSlCWdJkagx9xa8DqK/pzHYCtY7PokU6wASse3dWayc=
github.com/lightninglabs/taproot-assets/taprpc v1.0.1/go.mod h1:Ccq0t2GsXzOtC8qF0U1ux/yTF5HcBbVrhCb0tb/jObM=
github.com/lightninglabs/taproot-assets v0.5.2-0.20250508000445-bb5a2a6f154a h1:Jd2ned2248idCMgHirLYOtgJQp54GSNMFfOPH8bVSj0=
github.com/lightninglabs/taproot-assets v0.5.2-0.20250508000445-bb5a2a6f154a/go.mod h1:OdeFcj2bnJf6aaYjBB5c8KdNI3aDaEMQpsSu2EqvMlw=
github.com/lightninglabs/taproot-assets/taprpc v1.0.2 h1:LcK62+X7UYGFEwUgGwnKXLdoTOsBPFc6FOYXm7jiFFU=
github.com/lightninglabs/taproot-assets/taprpc v1.0.2/go.mod h1:Ccq0t2GsXzOtC8qF0U1ux/yTF5HcBbVrhCb0tb/jObM=
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.19.0-beta.rc3 h1:XWMlyZvBrp69AnQqrshLOOPZjOl4hFWR1RD4ceCXt9k=
Expand Down
56 changes: 55 additions & 1 deletion itest/assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,10 @@ func defaultCoOpCloseBalanceCheck(t *testing.T, local, remote *HarnessNode,
assetIDs [][]byte, groupKey []byte, universeTap *tapClient,
remoteBtcBalance, remoteAssetBalance bool) {

ctxb := context.Background()
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
defer cancel()

// With the channel closed, we'll now assert that the co-op close
// transaction was inserted into the local universe.
//
Expand Down Expand Up @@ -1941,10 +1945,34 @@ func defaultCoOpCloseBalanceCheck(t *testing.T, local, remote *HarnessNode,
closeTx.TxOut[localAssetIndex].PkScript,
)

// Because we don't exactly know what asset IDs made it into the close
// transaction, we need to fetch the closed channel to find that out.
closedChans, err := local.ClosedChannels(
ctxt, &lnrpc.ClosedChannelsRequest{
Cooperative: true,
},
)
require.NoError(t, err)
require.NotEmpty(t, closedChans.Channels)

var closedJsonChannel *rfqmsg.JsonAssetChannel
for _, closedChan := range closedChans.Channels {
if closedChan.ClosingTxHash == closeTx.TxHash().String() {
closedJsonChannel = &rfqmsg.JsonAssetChannel{}
err = json.Unmarshal(
closedChan.CustomChannelData, closedJsonChannel,
)
require.NoError(t, err)

break
}
}
require.NotNil(t, closedJsonChannel)

// We now verify the arrival of the local balance asset proof at the
// universe server.
var localAssetCloseOut rfqmsg.JsonCloseOutput
err := json.Unmarshal(
err = json.Unmarshal(
localCloseOut.CustomChannelData, &localAssetCloseOut,
)
require.NoError(t, err)
Expand All @@ -1956,6 +1984,19 @@ func defaultCoOpCloseBalanceCheck(t *testing.T, local, remote *HarnessNode,

require.Contains(t, assetIDStrings, assetIDStr)

// We only check for a proof if an asset of that asset ID was
// actually in the close output, which might not always be the
// case in grouped asset channels.
localAssetIDs := fn.NewSet[string](fn.Map(
func(t rfqmsg.JsonAssetTranche) string {
return t.AssetID
},
closedJsonChannel.LocalAssets,
)...)
if !localAssetIDs.Contains(assetIDStr) {
continue
}

assetID, err := hex.DecodeString(assetIDStr)
require.NoError(t, err)

Expand Down Expand Up @@ -1995,6 +2036,19 @@ func defaultCoOpCloseBalanceCheck(t *testing.T, local, remote *HarnessNode,

require.Contains(t, assetIDStrings, assetIDStr)

// We only check for a proof if an asset of that asset ID was
// actually in the close output, which might not always be the
// case in grouped asset channels.
remoteAssetIDs := fn.NewSet[string](fn.Map(
func(t rfqmsg.JsonAssetTranche) string {
return t.AssetID
},
closedJsonChannel.RemoteAssets,
)...)
if !remoteAssetIDs.Contains(assetIDStr) {
continue
}

assetID, err := hex.DecodeString(assetIDStr)
require.NoError(t, err)

Expand Down
5 changes: 1 addition & 4 deletions itest/litd_custom_channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1308,10 +1308,7 @@ func testCustomChannelsGroupTranchesForceClose(ctx context.Context,
closeAssetChannelAndAssert(
t, net, charlie, dave, chanPointCD,
[][]byte{assetID1, assetID2}, groupKey, universeTap,
// TODO(guggero): replace this with
// assertDefaultCoOpCloseBalance(true, true) once we have the
// ability to check the custom data in the closed channel list.
noOpCoOpCloseBalanceCheck,
assertDefaultCoOpCloseBalance(true, true),
)

assertSpendableBalance(
Expand Down
Loading