mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user