mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-04 18:52:44 +02:00
itest: remove redundant block in multiple tests
This commit is contained in:
@@ -1320,12 +1320,20 @@ func testDataLossProtection(ht *lntest.HarnessTest) {
|
|||||||
// information Dave needs to sweep his funds.
|
// information Dave needs to sweep his funds.
|
||||||
require.NoError(ht, restartDave(), "unable to restart Eve")
|
require.NoError(ht, restartDave(), "unable to restart Eve")
|
||||||
|
|
||||||
|
// Mine a block to trigger Dave's chain watcher to process Carol's sweep
|
||||||
|
// tx.
|
||||||
|
//
|
||||||
|
// TODO(yy): remove this block once the blockbeat starts remembering
|
||||||
|
// its last processed block and can handle looking for spends in the
|
||||||
|
// past blocks.
|
||||||
|
ht.MineEmptyBlocks(1)
|
||||||
|
|
||||||
|
// Make sure Dave still has the pending force close channel.
|
||||||
|
ht.AssertNumPendingForceClose(dave, 1)
|
||||||
|
|
||||||
// Dave should have a pending sweep.
|
// Dave should have a pending sweep.
|
||||||
ht.AssertNumPendingSweeps(dave, 1)
|
ht.AssertNumPendingSweeps(dave, 1)
|
||||||
|
|
||||||
// Mine a block to trigger the sweep.
|
|
||||||
ht.MineBlocks(1)
|
|
||||||
|
|
||||||
// Dave should sweep his funds.
|
// Dave should sweep his funds.
|
||||||
ht.AssertNumTxsInMempool(1)
|
ht.AssertNumTxsInMempool(1)
|
||||||
|
|
||||||
|
@@ -832,7 +832,6 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
|
|||||||
// we've already mined 1 block so we need one less than our CSV.
|
// we've already mined 1 block so we need one less than our CSV.
|
||||||
ht.MineBlocks(node.DefaultCSV - 1)
|
ht.MineBlocks(node.DefaultCSV - 1)
|
||||||
ht.AssertNumPendingSweeps(ht.Bob, 1)
|
ht.AssertNumPendingSweeps(ht.Bob, 1)
|
||||||
ht.MineEmptyBlocks(1)
|
|
||||||
ht.MineBlocksAndAssertNumTxes(1, 1)
|
ht.MineBlocksAndAssertNumTxes(1, 1)
|
||||||
|
|
||||||
// Restart bob so that we can test that he's able to recover everything
|
// Restart bob so that we can test that he's able to recover everything
|
||||||
@@ -852,6 +851,7 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
|
|||||||
ht.AssertNumPendingSweeps(ht.Bob, 0)
|
ht.AssertNumPendingSweeps(ht.Bob, 0)
|
||||||
ht.MineBlocksAndAssertNumTxes(1, 1)
|
ht.MineBlocksAndAssertNumTxes(1, 1)
|
||||||
|
|
||||||
|
// Assert that the HTLC has cleared.
|
||||||
ht.AssertHTLCNotActive(ht.Bob, testCase.channels[0], hash[:])
|
ht.AssertHTLCNotActive(ht.Bob, testCase.channels[0], hash[:])
|
||||||
ht.AssertHTLCNotActive(ht.Alice, testCase.channels[0], hash[:])
|
ht.AssertHTLCNotActive(ht.Alice, testCase.channels[0], hash[:])
|
||||||
|
|
||||||
@@ -866,8 +866,9 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Clean up the rest of our force close: mine blocks so that Bob's CSV
|
// 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.
|
// expires to trigger his sweep and then mine it.
|
||||||
ht.MineBlocks(node.DefaultCSV + 1)
|
ht.MineBlocks(node.DefaultCSV)
|
||||||
|
ht.AssertNumPendingSweeps(ht.Bob, 1)
|
||||||
ht.MineBlocksAndAssertNumTxes(1, 1)
|
ht.MineBlocksAndAssertNumTxes(1, 1)
|
||||||
|
|
||||||
// Bring carol back up so that we can close out the rest of our
|
// Bring carol back up so that we can close out the rest of our
|
||||||
|
@@ -117,9 +117,6 @@ func testWipeForwardingPackages(ht *lntest.HarnessTest) {
|
|||||||
// Alice should one pending sweep.
|
// Alice should one pending sweep.
|
||||||
ht.AssertNumPendingSweeps(alice, 1)
|
ht.AssertNumPendingSweeps(alice, 1)
|
||||||
|
|
||||||
// Mine a block to trigger the sweep.
|
|
||||||
ht.MineBlocks(1)
|
|
||||||
|
|
||||||
// Mine 1 block to get Alice's sweeping tx confirmed.
|
// Mine 1 block to get Alice's sweeping tx confirmed.
|
||||||
ht.MineBlocksAndAssertNumTxes(1, 1)
|
ht.MineBlocksAndAssertNumTxes(1, 1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user