Skip to content

Commit 951a473

Browse files
adi2011ShahanaFarooqui
authored andcommitted
tests: Fix test_emergencyrecover to check for ChannelReestablish
Make sure we are sending bogus channel reestablish after recovering from emergency.recover file and peer storage backup. Key Changes: - Add wait_for_log() with appropriate debug statements
1 parent 6ad55e9 commit 951a473

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_misc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,6 +2975,7 @@ def test_emergencyrecoverpenaltytxn(node_factory, bitcoind):
29752975
stubs = l1.rpc.emergencyrecover()["stubs"]
29762976
assert len(stubs) == 1
29772977
assert stubs[0] == _["channel_id"]
2978+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
29782979
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
29792980

29802981
# Restarting so that L1
@@ -3022,7 +3023,10 @@ def test_emergencyrecover(node_factory, bitcoind):
30223023
listfunds = l1.rpc.listfunds()["channels"][0]
30233024
assert listfunds["short_channel_id"] == "1x1x1"
30243025

3026+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
30253027
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
3028+
3029+
l2.daemon.wait_for_log('bad reestablish commitment_number: 0')
30263030
l2.daemon.wait_for_log('State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL')
30273031

30283032
bitcoind.generate_block(5, wait_for_mempool=1)
@@ -3143,7 +3147,10 @@ def test_restorefrompeer(node_factory, bitcoind):
31433147

31443148
assert l1.rpc.restorefrompeer()['stubs'][0] == _['channel_id']
31453149

3150+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
31463151
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
3152+
3153+
l2.daemon.wait_for_log('bad reestablish commitment_number: 0')
31473154
l2.daemon.wait_for_log('State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL')
31483155

31493156
bitcoind.generate_block(5, wait_for_mempool=1)

0 commit comments

Comments
 (0)