Skip to content

Commit

Permalink
itest: fix tests regarding the new sweeper behavior
Browse files Browse the repository at this point in the history
This commit fix watchtower, channel backup, and route blinding tests re
the new sweeper behavior.
  • Loading branch information
yyforyongyu committed Oct 15, 2024
1 parent a1f8432 commit 5d8ea80
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
3 changes: 0 additions & 3 deletions itest/lnd_channel_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,9 +1282,6 @@ func testDataLossProtection(ht *lntest.HarnessTest) {
// Dave should have a pending sweep.
ht.AssertNumPendingSweeps(dave, 1)

// Mine a block to trigger the sweep.
ht.MineBlocks(1)

// Dave should sweep his funds.
ht.AssertNumTxsInMempool(1)

Expand Down
12 changes: 7 additions & 5 deletions itest/lnd_route_blinding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,13 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
ht.AssertNumPendingSweeps(ht.Bob, 0)
ht.MineBlocksAndAssertNumTxes(1, 1)

// Clean up the rest of our force close: mine blocks so that Bob's CSV
// expires plus one block to trigger his sweep and then mine it.
ht.MineBlocks(node.DefaultCSV - 1)
ht.AssertNumPendingSweeps(ht.Bob, 1)
ht.MineBlocksAndAssertNumTxes(1, 1)

// Assert that the HTLC has cleared.
ht.AssertHTLCNotActive(ht.Bob, testCase.channels[0], hash[:])
ht.AssertHTLCNotActive(ht.Alice, testCase.channels[0], hash[:])

Expand All @@ -865,11 +872,6 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
lnrpc.Failure_INVALID_ONION_BLINDING,
)

// Clean up the rest of our force close: mine blocks so that Bob's CSV
// expires plus one block to trigger his sweep and then mine it.
ht.MineBlocks(node.DefaultCSV + 1)
ht.MineBlocksAndAssertNumTxes(1, 1)

// Bring carol back up so that we can close out the rest of our
// channels cooperatively. She requires an interceptor to start up
// so we just re-register our interceptor.
Expand Down
10 changes: 0 additions & 10 deletions itest/lnd_watchtower_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,16 +579,6 @@ func testRevokedCloseRetributionAltruistWatchtowerCase(ht *lntest.HarnessTest,

ht.AssertNumPendingForceClose(dave, 0)

// If this is an anchor channel, Dave would offer his sweeper the
// anchor. However, due to no time-sensitive outputs involved, the
// anchor sweeping won't happen as it's uneconomical.
if lntest.CommitTypeHasAnchors(commitType) {
ht.AssertNumPendingSweeps(dave, 1)

// Mine a block to trigger the sweep.
ht.MineEmptyBlocks(1)
}

// Check that Dave's wallet balance is increased.
err = wait.NoError(func() error {
daveBalResp := dave.RPC.WalletBalance()
Expand Down
3 changes: 0 additions & 3 deletions itest/lnd_wipe_fwdpkgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ func testWipeForwardingPackages(ht *lntest.HarnessTest) {
// Alice should one pending sweep.
ht.AssertNumPendingSweeps(alice, 1)

// Mine a block to trigger the sweep.
ht.MineBlocks(1)

// Mine 1 block to get Alice's sweeping tx confirmed.
ht.MineBlocksAndAssertNumTxes(1, 1)

Expand Down

0 comments on commit 5d8ea80

Please sign in to comment.