itests: add itest for ListSweeps's start_height

This commit is contained in:
Andras Banki-Horvath
2024-02-01 20:47:10 +01:00
parent 7725a57055
commit 187e61da23
5 changed files with 112 additions and 6 deletions

View File

@@ -2041,10 +2041,10 @@ func (h *HarnessTest) FindCommitAndAnchor(sweepTxns []*wire.MsgTx,
//
// NOTE: Does not account for node's internal state.
func (h *HarnessTest) AssertSweepFound(hn *node.HarnessNode,
sweep string, verbose bool) {
sweep string, verbose bool, startHeight int32) {
// List all sweeps that alice's node had broadcast.
sweepResp := hn.RPC.ListSweeps(verbose)
sweepResp := hn.RPC.ListSweeps(verbose, startHeight)
var found bool
if verbose {

View File

@@ -159,11 +159,16 @@ func (h *HarnessRPC) VerifyMessageWithAddr(
}
// ListSweeps makes a ListSweeps RPC call to the node's WalletKit client.
func (h *HarnessRPC) ListSweeps(verbose bool) *walletrpc.ListSweepsResponse {
func (h *HarnessRPC) ListSweeps(verbose bool,
startHeight int32) *walletrpc.ListSweepsResponse {
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
req := &walletrpc.ListSweepsRequest{Verbose: verbose}
req := &walletrpc.ListSweepsRequest{
Verbose: verbose,
StartHeight: startHeight,
}
resp, err := h.WalletKit.ListSweeps(ctxt, req)
h.NoError(err, "ListSweeps")