Browse Source

df-tests: test_disconnect_half_signed + test_reconnect_signed

ppa
niftynei 4 years ago
committed by Christian Decker
parent
commit
a357e75c5d
  1. 13
      tests/test_connection.py

13
tests/test_connection.py

@ -382,6 +382,8 @@ def test_disconnect_half_signed(node_factory):
# Now, these are the corner cases. Fundee sends funding_signed, # Now, these are the corner cases. Fundee sends funding_signed,
# but opener doesn't receive it. # but opener doesn't receive it.
disconnects = ['@WIRE_FUNDING_SIGNED'] disconnects = ['@WIRE_FUNDING_SIGNED']
if EXPERIMENTAL_DUAL_FUND:
disconnects = ['@WIRE_COMMITMENT_SIGNED']
l1 = node_factory.get_node() l1 = node_factory.get_node()
l2 = node_factory.get_node(disconnect=disconnects) l2 = node_factory.get_node(disconnect=disconnects)
@ -400,6 +402,9 @@ def test_disconnect_half_signed(node_factory):
def test_reconnect_signed(node_factory): def test_reconnect_signed(node_factory):
# This will fail *after* both sides consider channel opening. # This will fail *after* both sides consider channel opening.
disconnects = ['+WIRE_FUNDING_SIGNED'] disconnects = ['+WIRE_FUNDING_SIGNED']
if EXPERIMENTAL_DUAL_FUND:
disconnects = ['+WIRE_COMMITMENT_SIGNED']
l1 = node_factory.get_node(may_reconnect=True) l1 = node_factory.get_node(may_reconnect=True)
l2 = node_factory.get_node(disconnect=disconnects, l2 = node_factory.get_node(disconnect=disconnects,
may_reconnect=True) may_reconnect=True)
@ -414,8 +419,12 @@ def test_reconnect_signed(node_factory):
assert l2.rpc.getpeer(l1.info['id'])['id'] == l1.info['id'] assert l2.rpc.getpeer(l1.info['id'])['id'] == l1.info['id']
# Technically, this is async to fundchannel (and could reconnect first) # Technically, this is async to fundchannel (and could reconnect first)
l1.daemon.wait_for_logs(['sendrawtx exit 0', if EXPERIMENTAL_DUAL_FUND:
'Peer has reconnected, state CHANNELD_AWAITING_LOCKIN']) l1.daemon.wait_for_logs(['sendrawtx exit 0',
'Peer has reconnected, state DUALOPEND_OPEN_INIT'])
else:
l1.daemon.wait_for_logs(['sendrawtx exit 0',
'Peer has reconnected, state CHANNELD_AWAITING_LOCKIN'])
l1.bitcoin.generate_block(6) l1.bitcoin.generate_block(6)

Loading…
Cancel
Save