mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 10:12:28 +02:00
lntest+itest: make sure mempool is cleaned in watcher tower test
This commit adds the missing check for anchor sweep in test `revoked_uncooperative_close_retribution_altruist_watchtower`, also change the mempool check a bit so it's easier to track.
This commit is contained in:
@@ -349,10 +349,6 @@ func (h *HarnessTest) Subtest(t *testing.T) *HarnessTest {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// We require the mempool to be cleaned from the test.
|
|
||||||
require.Empty(st, st.Miner.GetRawMempool(), "mempool not "+
|
|
||||||
"cleaned, please mine blocks to clean them all.")
|
|
||||||
|
|
||||||
// When we finish the test, reset the nodes' configs and take a
|
// When we finish the test, reset the nodes' configs and take a
|
||||||
// snapshot of each of the nodes' internal states.
|
// snapshot of each of the nodes' internal states.
|
||||||
for _, node := range st.manager.standbyNodes {
|
for _, node := range st.manager.standbyNodes {
|
||||||
@@ -362,8 +358,9 @@ func (h *HarnessTest) Subtest(t *testing.T) *HarnessTest {
|
|||||||
// If found running nodes, shut them down.
|
// If found running nodes, shut them down.
|
||||||
st.shutdownNonStandbyNodes()
|
st.shutdownNonStandbyNodes()
|
||||||
|
|
||||||
// Assert that mempool is cleaned
|
// We require the mempool to be cleaned from the test.
|
||||||
st.Miner.AssertNumTxsInMempool(0)
|
require.Empty(st, st.Miner.GetRawMempool(), "mempool not "+
|
||||||
|
"cleaned, please mine blocks to clean them all.")
|
||||||
|
|
||||||
// Finally, cancel the run context. We have to do it here
|
// Finally, cancel the run context. We have to do it here
|
||||||
// because we need to keep the context alive for the above
|
// because we need to keep the context alive for the above
|
||||||
|
@@ -849,6 +849,11 @@ func testRevokedCloseRetributionAltruistWatchtowerCase(ht *lntemp.HarnessTest,
|
|||||||
|
|
||||||
ht.AssertNumPendingForceClose(dave, 0)
|
ht.AssertNumPendingForceClose(dave, 0)
|
||||||
|
|
||||||
|
// If this is an anchor channel, Dave would sweep the anchor.
|
||||||
|
if anchors {
|
||||||
|
ht.MineBlocksAndAssertNumTxes(1, 1)
|
||||||
|
}
|
||||||
|
|
||||||
// Check that Dave's wallet balance is increased.
|
// Check that Dave's wallet balance is increased.
|
||||||
err = wait.NoError(func() error {
|
err = wait.NoError(func() error {
|
||||||
daveBalResp := dave.RPC.WalletBalance()
|
daveBalResp := dave.RPC.WalletBalance()
|
||||||
|
Reference in New Issue
Block a user