itest+lntest: return the error from SendCoinsAssertErr

Also rename the send all coins test for clarity.
This commit is contained in:
yyforyongyu committed 2024-08-07 20:42:28 +08:00
1 parent 018484628a
commit 0041426e7e
3 files changed
+19 -11

No files matched your search

+3 -1
View File
@@ -378,12 +378,14 @@ func (h *HarnessRPC) SendCoins(
// SendCoinsAssertErr sends a given amount of money to the specified address
// from the passed node and asserts an error has returned.
func (h *HarnessRPC) SendCoinsAssertErr(req *lnrpc.SendCoinsRequest) {
func (h *HarnessRPC) SendCoinsAssertErr(req *lnrpc.SendCoinsRequest) error {
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
defer cancel()
_, err := h.LN.SendCoins(ctxt, req)
require.Error(h, err, "node %s didn't not return an error", h.Name)
return err
}
// GetTransactions makes a RPC call to GetTransactions and asserts.