mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: make test_no_fee_estimate more reliable.
1. Wait for a 'sendrawtransaction' *after* the dev-fail message; don't be fooled by a previous one. 2. Turning on estimate fee sets fees exactly; just wait for it to be processed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
33c6285787
commit
7e1fd9c38a
@@ -1142,6 +1142,7 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
|
|||||||
# Make sure we clean up cahnnel for later attempt.
|
# Make sure we clean up cahnnel for later attempt.
|
||||||
l1.daemon.wait_for_log('sendrawtx exit 0')
|
l1.daemon.wait_for_log('sendrawtx exit 0')
|
||||||
l1.rpc.dev_fail(l2.info['id'])
|
l1.rpc.dev_fail(l2.info['id'])
|
||||||
|
l1.daemon.wait_for_log('Failing due to dev-fail command')
|
||||||
l1.daemon.wait_for_log('sendrawtx exit 0')
|
l1.daemon.wait_for_log('sendrawtx exit 0')
|
||||||
bitcoind.generate_block(6)
|
bitcoind.generate_block(6)
|
||||||
wait_for(lambda: only_one(l1.rpc.getpeer(l2.info['id'])['channels'])['state'] == 'ONCHAIN')
|
wait_for(lambda: only_one(l1.rpc.getpeer(l2.info['id'])['channels'])['state'] == 'ONCHAIN')
|
||||||
@@ -1163,14 +1164,14 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
|
|||||||
l2.fund_channel(l1, 10**6)
|
l2.fund_channel(l1, 10**6)
|
||||||
l2.pay(l1, 10**9 // 2)
|
l2.pay(l1, 10**9 // 2)
|
||||||
l1.rpc.dev_fail(l2.info['id'])
|
l1.rpc.dev_fail(l2.info['id'])
|
||||||
|
l1.daemon.wait_for_log('Failing due to dev-fail command')
|
||||||
l1.daemon.wait_for_log('sendrawtx exit 0')
|
l1.daemon.wait_for_log('sendrawtx exit 0')
|
||||||
bitcoind.generate_block(5)
|
bitcoind.generate_block(5)
|
||||||
l1.daemon.wait_for_log('sendrawtx exit 0')
|
l1.daemon.wait_for_log('sendrawtx exit 0')
|
||||||
bitcoind.generate_block(100)
|
bitcoind.generate_block(100)
|
||||||
|
|
||||||
# Restart estimatesmartfee, wait for it to pass 5000
|
# Start estimatesmartfee.
|
||||||
l1.set_feerates((15000, 7500, 3750), True)
|
l1.set_feerates((15000, 7500, 3750), True)
|
||||||
l1.daemon.wait_for_log('Feerate estimate for normal set to [567][0-9]{3}')
|
|
||||||
|
|
||||||
# Can now fund a channel (as a test, use slow feerate).
|
# Can now fund a channel (as a test, use slow feerate).
|
||||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||||
|
|||||||
Reference in New Issue
Block a user