Skip to content

Commit b7b351f

Browse files
committed
itest: remove redundant block in multiple tests
1 parent 945d778 commit b7b351f

3 files changed

+14
-9
lines changed

itest/lnd_channel_backup_test.go

+11-3
Original file line numberDiff line numberDiff line change
@@ -1320,12 +1320,20 @@ func testDataLossProtection(ht *lntest.HarnessTest) {
13201320
// information Dave needs to sweep his funds.
13211321
require.NoError(ht, restartDave(), "unable to restart Eve")
13221322

1323+
// Mine a block to trigger Dave's chain watcher to process Carol's sweep
1324+
// tx.
1325+
//
1326+
// TODO(yy): remove this block once the blockbeat starts remembering
1327+
// its last processed block and can handle looking for spends in the
1328+
// past blocks.
1329+
ht.MineEmptyBlocks(1)
1330+
1331+
// Make sure Dave still has the pending force close channel.
1332+
ht.AssertNumPendingForceClose(dave, 1)
1333+
13231334
// Dave should have a pending sweep.
13241335
ht.AssertNumPendingSweeps(dave, 1)
13251336

1326-
// Mine a block to trigger the sweep.
1327-
ht.MineBlocks(1)
1328-
13291337
// Dave should sweep his funds.
13301338
ht.AssertNumTxsInMempool(1)
13311339

itest/lnd_route_blinding_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,6 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
832832
// we've already mined 1 block so we need one less than our CSV.
833833
ht.MineBlocks(node.DefaultCSV - 1)
834834
ht.AssertNumPendingSweeps(ht.Bob, 1)
835-
ht.MineEmptyBlocks(1)
836835
ht.MineBlocksAndAssertNumTxes(1, 1)
837836

838837
// Restart bob so that we can test that he's able to recover everything
@@ -852,6 +851,7 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
852851
ht.AssertNumPendingSweeps(ht.Bob, 0)
853852
ht.MineBlocksAndAssertNumTxes(1, 1)
854853

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

@@ -866,8 +866,8 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
866866
)
867867

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

873873
// Bring carol back up so that we can close out the rest of our

itest/lnd_wipe_fwdpkgs_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ func testWipeForwardingPackages(ht *lntest.HarnessTest) {
117117
// Alice should one pending sweep.
118118
ht.AssertNumPendingSweeps(alice, 1)
119119

120-
// Mine a block to trigger the sweep.
121-
ht.MineBlocks(1)
122-
123120
// Mine 1 block to get Alice's sweeping tx confirmed.
124121
ht.MineBlocksAndAssertNumTxes(1, 1)
125122

0 commit comments

Comments
 (0)