itest+lntest: fix channel force close itest

This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:36 +08:00
1 parent 6933c5a86c
commit ce58175314
3 files changed
+189 -200

No files matched your search

+8 -1
View File
@@ -2594,12 +2594,17 @@ func (h *HarnessTest) AssertWalletLockedBalance(hn *node.HarnessNode,
// AssertNumPendingSweeps asserts the number of pending sweeps for the given
// node.
func (h *HarnessTest) AssertNumPendingSweeps(hn *node.HarnessNode, n int) {
func (h *HarnessTest) AssertNumPendingSweeps(hn *node.HarnessNode,
n int) []*walletrpc.PendingSweep {
results := make([]*walletrpc.PendingSweep, 0, n)
err := wait.NoError(func() error {
resp := hn.RPC.PendingSweeps()
num := len(resp.PendingSweeps)
if num == n {
results = resp.PendingSweeps
return nil
}
@@ -2614,6 +2619,8 @@ func (h *HarnessTest) AssertNumPendingSweeps(hn *node.HarnessNode, n int) {
}, DefaultTimeout)
require.NoErrorf(h, err, "%s: check pending sweeps timeout", hn.Name())
return results
}
// FindSweepingTxns asserts the expected number of sweeping txns are found in