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:
yyforyongyu committed 2024-12-20 17:54:12 +08:00
1 parent 36a87ad5f4
commit c4a6abb14d
3 files changed
+117 -92

No files matched your search

+6 -2
View File
@@ -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.