lntest+itest: fix testOpenChannelLockedBalance

This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:24 +08:00
1 parent 536ac9f8a4
commit 6f5b7a9fd3
2 files changed
+33 -8

No files matched your search

+19
View File
@@ -2572,3 +2572,22 @@ func (h *HarnessTest) MineClosingTx(cp *lnrpc.ChannelPoint,
return closeTx
}
// AssertWalletLockedBalance asserts the expected amount has been marked as
// locked in the node's WalletBalance response.
func (h *HarnessTest) AssertWalletLockedBalance(hn *node.HarnessNode,
balance int64) {
err := wait.NoError(func() error {
balanceResp := hn.RPC.WalletBalance()
got := balanceResp.LockedBalance
if got != balance {
return fmt.Errorf("want %d, got %d", balance, got)
}
return nil
}, wait.DefaultTimeout)
require.NoError(h, err, "%s: timeout checking locked balance",
hn.Name())
}