From 245807a085274efaa19e44f212d14f78fcef8078 Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Mon, 18 Mar 2019 18:55:48 +0200 Subject: [PATCH] pytest: tighten a log test `Owning output...` with address type and confirmation Because the call (wallet_extract_owned outputs) that prints that line can happen _before_ or _after_ confirmation in block, adding `CONFIRMED` in the later. --- tests/test_closing.py | 4 ++-- tests/test_misc.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index 18d8f74cb..717bbf939 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -66,8 +66,8 @@ def test_closing(node_factory, bitcoind): ] bitcoind.generate_block(1) - l1.daemon.wait_for_log(r'Owning output .* txid %s' % closetxid) - l2.daemon.wait_for_log(r'Owning output .* txid %s' % closetxid) + l1.daemon.wait_for_log(r'Owning output.* \(SEGWIT\).* txid %s.* CONFIRMED' % closetxid) + l2.daemon.wait_for_log(r'Owning output.* \(SEGWIT\).* txid %s.* CONFIRMED' % closetxid) # Make sure both nodes have grabbed their close tx funds assert closetxid in set([o['txid'] for o in l1.rpc.listfunds()['outputs']]) diff --git a/tests/test_misc.py b/tests/test_misc.py index b53bc7b98..745c45152 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -868,7 +868,7 @@ def test_blockchaintrack(node_factory, bitcoind): """Check that we track the blockchain correctly across reorgs """ l1 = node_factory.get_node(random_hsm=True) - addr = l1.rpc.newaddr()['bech32'] + addr = l1.rpc.newaddr(addresstype='all')['p2sh-segwit'] ###################################################################### # First failure scenario: rollback on startup doesn't work, @@ -883,7 +883,7 @@ def test_blockchaintrack(node_factory, bitcoind): time.sleep(1) # mempool is still unpredictable bitcoind.generate_block(1) - l1.daemon.wait_for_log(r'Owning') + l1.daemon.wait_for_log(r'Owning output.* \(P2SH\).* CONFIRMED') outputs = l1.rpc.listfunds()['outputs'] assert len(outputs) == 1