From f341b508e1f47da2ad45c1ec6c49cdebded2bbd7 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 22 Mar 2018 00:38:09 +0100 Subject: [PATCH] pytest: Add checks that funding change and to_us get confirmed Signed-off-by: Christian Decker --- tests/test_lightningd.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 107473c41..536d3a31a 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -1290,6 +1290,9 @@ class LightningDTests(BaseLightningDTests): l1, l2 = self.connect() self.fund_channel(l1, l2, 10**6) + + # The funding change should be confirmed and our only output + assert [o['status'] for o in l1.rpc.listfunds()['outputs']] == ['confirmed'] self.pay(l1, l2, 200000000) # Make sure l2 has received sig with 0 htlcs! @@ -1348,8 +1351,10 @@ class LightningDTests(BaseLightningDTests): bitcoind.generate_block(5) wait_forget_channels(l2) - # Only l1 has a direct output since all of l2's outputs are respent (it failed) - assert closetxid in set([o['txid'] for o in l1.rpc.listfunds()['outputs']]) + # Only l1 has a direct output since all of l2's outputs are respent (it + # failed). Also the output should now be listed as confirmed since we + # generated some more blocks. + assert (closetxid, "confirmed") in set([(o['txid'], o['status']) for o in l1.rpc.listfunds()['outputs']]) addr = l1.bitcoin.rpc.getnewaddress() l1.rpc.withdraw(addr, "all")