lntest+itest: remove the usage of ht.AssertActiveHtlcs
The method `AssertActiveHtlcs` is now removed due to it's easy to be misused. To assert a given htlc, use `AssertOutgoingHTLCActive` and `AssertIncomingHTLCActive` instead for ensuring the HTLC exists in the right direction. Although often the case `AssertNumActiveHtlcs` would be enough as it implicitly checks the forwarding behavior for an intermediate node by asserting there are always num_payment*2 HTLCs.
This commit is contained in:
3 files changed
+117
-92
No files matched your search
@@ -50,8 +50,12 @@ func testHoldInvoiceForceClose(ht *lntest.HarnessTest) {
|
||||
|
||||
// Once the HTLC has cleared, alice and bob should both have a single
|
||||
// htlc locked in.
|
||||
ht.AssertActiveHtlcs(alice, payHash[:])
|
||||
ht.AssertActiveHtlcs(bob, payHash[:])
|
||||
//
|
||||
// Alice should have one outgoing HTLCs on channel Alice -> Bob.
|
||||
ht.AssertOutgoingHTLCActive(alice, chanPoint, payHash[:])
|
||||
|
||||
// Bob should have one incoming HTLC on channel Alice -> Bob.
|
||||
ht.AssertIncomingHTLCActive(bob, chanPoint, payHash[:])
|
||||
|
||||
// Get our htlc expiry height and current block height so that we
|
||||
// can mine the exact number of blocks required to expire the htlc.
|
||||
|
||||
Reference in new issue
Block a user