Skip to content

Commit 22ec4c5

Browse files
committed
itest: fix assertion for grouped asset chan itest
We should only have 2 outputs, the test asserted 3 before as the co-op close transaction couldn't properly spend the funding input. We also assert the normal balance now as now that we import the funding outputs as proofs, this no longer incorrectly shows up as the balance.
1 parent 8b2ffd7 commit 22ec4c5

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

itest/assets_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,8 @@ func waitForSendEvent(t *testing.T,
895895
sendEvents taprpc.TaprootAssets_SubscribeSendEventsClient,
896896
expectedState tapfreighter.SendState) {
897897

898+
t.Helper()
899+
898900
for {
899901
sendEvent, err := sendEvents.Recv()
900902
require.NoError(t, err)
@@ -911,6 +913,8 @@ func closeAssetChannelAndAssert(t *harnessTest, net *NetworkHarness,
911913
assetID, groupKey []byte, universeTap *tapClient, remoteBtcBalance,
912914
remoteAssetBalance bool) {
913915

916+
t.t.Helper()
917+
914918
ctxb := context.Background()
915919
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
916920
defer cancel()

itest/litd_custom_channels_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -882,14 +882,9 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
882882
false,
883883
)
884884

885-
// For some reason, the channel funding output of the immediately closed
886-
// channel is still present in the asset DB, even after we import the
887-
// co-op close transaction proof.
888-
// TODO(guggero): Investigate this. The actual number of outputs should
889-
// be two here, and we shouldn't have the extra fundingAmount in the
890-
// balance.
891-
charlieAssetBalance += fundingAmount
892-
assertNumAssetOutputs(t.t, charlieTap, assetID, 3)
885+
// Charlie should have asset outputs: the left over change from the
886+
// channel funding, and the new close output.
887+
assertNumAssetOutputs(t.t, charlieTap, assetID, 2)
893888

894889
// The asset balances should still remain unchanged.
895890
assertAssetBalance(t.t, charlieTap, assetID, charlieAssetBalance)

0 commit comments

Comments
 (0)