pytest: clean up wait_for_onchaind_tx interface, remove wait_for_onchaind_broadcast

Using single tuples in Python is ugly, so:
1. Rename wait_for_onchaind_tx to wait_for_onchaind_txs.
2. Make it take tuples explicitly.
3. Make wait_for_onchaind_tx a simpler wrapper/unwrapper.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-04-06 09:03:25 +09:30
parent 0c27acc705
commit c5b7dbcd98
7 changed files with 116 additions and 113 deletions

View File

@@ -44,8 +44,8 @@ def test_bookkeeping_closing_trimmed_htlcs(node_factory, bitcoind, executor):
l1.daemon.wait_for_log(' to ONCHAIN')
l2.daemon.wait_for_log(' to ONCHAIN')
((_, txid, blocks),) = l1.wait_for_onchaind_tx('OUR_DELAYED_RETURN_TO_WALLET',
'OUR_UNILATERAL/DELAYED_OUTPUT_TO_US')
_, txid, blocks = l1.wait_for_onchaind_tx('OUR_DELAYED_RETURN_TO_WALLET',
'OUR_UNILATERAL/DELAYED_OUTPUT_TO_US')
assert blocks == 4
bitcoind.generate_block(4)
bitcoind.generate_block(20, wait_for_mempool=txid)
@@ -90,8 +90,8 @@ def test_bookkeeping_closing_subsat_htlcs(node_factory, bitcoind, chainparams):
l1.rpc.close(l2.info['id'], 1)
bitcoind.generate_block(1, wait_for_mempool=1)
((_, txid, blocks),) = l1.wait_for_onchaind_tx('OUR_DELAYED_RETURN_TO_WALLET',
'OUR_UNILATERAL/DELAYED_OUTPUT_TO_US')
_, txid, blocks = l1.wait_for_onchaind_tx('OUR_DELAYED_RETURN_TO_WALLET',
'OUR_UNILATERAL/DELAYED_OUTPUT_TO_US')
assert blocks == 4
bitcoind.generate_block(4)