Skip to content

Commit 441b074

Browse files
committed
itest: add logging split force close tests
1 parent 7c8b3f4 commit 441b074

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

itest/litd_custom_channels_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,6 +3096,14 @@ func testCustomChannelsHtlcForceClose(ctxb context.Context, net *NetworkHarness,
30963096
t *harnessTest) {
30973097

30983098
runCustomChannelsHtlcForceClose(ctxb, t, net, false)
3099+
}
3100+
3101+
// testCustomChannelsHtlcForceCloseMpp tests that we can force close a channel
3102+
// with HTLCs in both directions and that the HTLC outputs are correctly
3103+
// swept, using MPP.
3104+
func testCustomChannelsHtlcForceCloseMpp(ctxb context.Context,
3105+
net *NetworkHarness, t *harnessTest) {
3106+
30993107
runCustomChannelsHtlcForceClose(ctxb, t, net, true)
31003108
}
31013109

@@ -3257,6 +3265,7 @@ func runCustomChannelsHtlcForceClose(ctx context.Context, t *harnessTest,
32573265
numAdditionalShards := assetInvoiceAmt / assetsPerMPPShard
32583266
numHtlcs += numAdditionalShards * 2
32593267
}
3268+
t.Logf("Asserting both Alice and Bob have %d HTLCs...", numHtlcs)
32603269
assertNumHtlcs(t.t, alice, numHtlcs)
32613270
assertNumHtlcs(t.t, bob, numHtlcs)
32623271

@@ -3523,6 +3532,13 @@ func runCustomChannelsHtlcForceClose(ctx context.Context, t *harnessTest,
35233532

35243533
t.Logf("Confirming initial HTLC timeout txns")
35253534

3535+
timeoutSweeps, err := waitForNTxsInMempool(
3536+
net.Miner.Client, 2, shortTimeout,
3537+
)
3538+
require.NoError(t.t, err)
3539+
3540+
t.Logf("Asserting balance on sweeps: %v", timeoutSweeps)
3541+
35263542
// Finally, we'll mine a single block to confirm them.
35273543
mineBlocks(t, net, 1, 2)
35283544

itest/litd_test_list_on_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ var allTestCases = []*testCase{
5252
name: "test custom channels htlc force close",
5353
test: testCustomChannelsHtlcForceClose,
5454
},
55+
{
56+
name: "test custom channels htlc force close MPP",
57+
test: testCustomChannelsHtlcForceCloseMpp,
58+
},
5559
{
5660
name: "test custom channels balance consistency",
5761
test: testCustomChannelsBalanceConsistency,

0 commit comments

Comments
 (0)