Skip to content

Commit f7f0876

Browse files
committed
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 46ff44a commit f7f0876

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_misc.py

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

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

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

30273031
bitcoind.generate_block(5, wait_for_mempool=1)
@@ -3140,7 +3144,10 @@ def test_restorefrompeer(node_factory, bitcoind):
31403144

31413145
assert l1.rpc.restorefrompeer()['stubs'][0] == _['channel_id']
31423146

3147+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
31433148
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
3149+
3150+
l2.daemon.wait_for_log('bad reestablish commitment_number: 0')
31443151
l2.daemon.wait_for_log('State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL')
31453152

31463153
bitcoind.generate_block(5, wait_for_mempool=1)

0 commit comments

Comments
 (0)