tests/test_misc.py: Check if funds are getting recovered on reconnecting... Changelog-None: Increasing test scope

This commit is contained in:
adi2011 2022-07-19 18:45:49 +05:30 committed by Christian Decker
parent 335f52d1a8
commit e7e7a7186f
1 changed files with 15 additions and 1 deletions

View File

@ -2316,7 +2316,9 @@ def test_emergencyrecover(node_factory, bitcoind):
"""
Test emergencyrecover
"""
l1, l2 = node_factory.get_nodes(2, opts=[{}, {}])
l1, l2 = node_factory.get_nodes(2, opts=[{'allow_broken_log': True, 'may_reconnect': True},
{'may_reconnect': True}])
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
c12, _ = l1.fundchannel(l2, 10**5)
stubs = l1.rpc.emergencyrecover()["stubs"]
@ -2336,6 +2338,18 @@ def test_emergencyrecover(node_factory, bitcoind):
listfunds = l1.rpc.listfunds()["channels"][0]
assert listfunds["short_channel_id"] == "1x1x1"
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
l2.daemon.wait_for_log('State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL')
l2.bitcoin.generate_block(5)
sync_blockheight(bitcoind, [l1, l2])
l1.daemon.wait_for_log(r'All outputs resolved.*')
wait_for(lambda: l1.rpc.listfunds()["channels"][0]["state"] == "ONCHAIN")
# Check if funds are recovered.
assert l1.rpc.listfunds()["channels"][0]["state"] == "ONCHAIN"
assert l2.rpc.listfunds()["channels"][0]["state"] == "ONCHAIN"
def test_commitfee_option(node_factory):
"""Sanity check for the --commit-fee startup option."""