itest: manage context within HarnessNode

This commit removes the context as a param needed when calling methods
of HarnessNode. This change moves the context management inside
HarnessNode, aside from saving us a few lines, it makes the context
creation/timeout less error-prone.
This commit is contained in:
yyforyongyu committed 2021-12-04 14:54:36 +08:00
1 parent 6f59f41e86
commit 26ed64fa52
30 files changed
+186 -309

No files matched your search

+2 -4
View File
@@ -245,11 +245,9 @@ func testSendPaymentAMPInvoiceRepeat(net *lntest.NetworkHarness,
Amt: chanAmt,
},
)
ctxt, _ := context.WithTimeout(ctxb, defaultTimeout)
err = carol.WaitForNetworkChannelOpen(ctxt, chanPoint)
err = carol.WaitForNetworkChannelOpen(chanPoint)
require.NoError(t.t, err, "carol didn't report channel")
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
err = dave.WaitForNetworkChannelOpen(ctxt, chanPoint)
err = dave.WaitForNetworkChannelOpen(chanPoint)
require.NoError(t.t, err, "dave didn't report channel")
// Create an AMP invoice of a trivial amount, that we'll pay repeatedly