From 6901f8e7f52cba93cbd7c7d3781a506dfae87743 Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Mon, 2 Sep 2024 17:24:56 +0100 Subject: [PATCH] func test: wait for block heights to match This is copied from darosior's changes in https://github.com/wizardsardine/liana/pull/1222#issuecomment-2324894986. --- tests/test_rpc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_rpc.py b/tests/test_rpc.py index dedc81bc4..9d9aef1ec 100644 --- a/tests/test_rpc.py +++ b/tests/test_rpc.py @@ -902,6 +902,9 @@ def test_create_recovery(lianad, bitcoind): bitcoind.generate_block(9, wait_for_mempool=txid) # Now we can create a recovery tx that sweeps the first 3 coins. + wait_for( + lambda: lianad.rpc.getinfo()["block_height"] == bitcoind.rpc.getblockcount() + ) res = lianad.rpc.createrecovery(bitcoind.rpc.getnewaddress(), 18) reco_psbt = PSBT.from_base64(res["psbt"])