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 Jul 18, 2024
1 parent 6addf7e commit be50d50
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 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 @@ -1268,9 +1268,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
14 changes: 6 additions & 8 deletions itest/lnd_route_blinding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,10 +1029,13 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
ht.AssertNumPendingSweeps(ht.Bob, 0)
ht.MineBlocksAndAssertNumTxes(1, 1)

// Assert that the HTLC has cleared.
ht.WaitForBlockchainSync(ht.Bob)
ht.WaitForBlockchainSync(ht.Alice)
// 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 @@ -1046,11 +1049,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 be50d50

Please sign in to comment.