From e92ab89087ab0ca1ae64d2c35f8a1a5b8979a8cc Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Sun, 9 Feb 2020 17:47:52 +0100 Subject: [PATCH] test: uses wait_for_htlcs helper in test_pay --- tests/test_pay.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_pay.py b/tests/test_pay.py index 05b8ec850..b4298a16c 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -2299,8 +2299,8 @@ def test_channel_drainage(node_factory, bitcoind): l1.rpc.waitsendpay(payment_hash, 10) # wait until totally settled - wait_for(lambda: len(l1.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0) - wait_for(lambda: len(l2.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0) + l1.wait_for_htlcs() + l2.wait_for_htlcs() # But we can get more! By using a trimmed htlc output; this doesn't cause # an increase in tx fee, so it's allowed. @@ -2311,8 +2311,8 @@ def test_channel_drainage(node_factory, bitcoind): l1.rpc.waitsendpay(payment_hash, TIMEOUT) # wait until totally settled - wait_for(lambda: len(l1.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0) - wait_for(lambda: len(l2.rpc.listpeers()['peers'][0]['channels'][0]['htlcs']) == 0) + l1.wait_for_htlcs() + l2.wait_for_htlcs() # Now, l1 is paying fees, but it can't afford a larger tx, so any # attempt to add an HTLC which is not trimmed will fail.