MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_multiple_channels

Function test_multiple_channels

tests/test_connection.py:2686–2709  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

2684
2685
2686def test_multiple_channels(node_factory):
2687 l1 = node_factory.get_node()
2688 l2 = node_factory.get_node()
2689
2690 ret = l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
2691 assert ret['id'] == l2.info['id']
2692
2693 for i in range(3):
2694 chan, _ = l1.fundchannel(l2, 10**6)
2695
2696 l1.rpc.close(chan)
2697
2698 # If we don't wait for l2 to make the transition we can end up
2699 # attempting to re-estabilishing the channel
2700 l2.daemon.wait_for_log(
2701 r'State changed from CLOSINGD_SIGEXCHANGE to CLOSINGD_COMPLETE'
2702 )
2703
2704 channels = l1.rpc.listpeerchannels()['channels']
2705 assert len(channels) == 3
2706 # Most in state ONCHAIN, last is CLOSINGD_COMPLETE
2707 for i in range(len(channels) - 1):
2708 assert channels[i]['state'] == 'ONCHAIN'
2709 assert channels[-1]['state'] == 'CLOSINGD_COMPLETE'
2710
2711
2712@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 6

wait_for_logMethod · 0.80
listpeerchannelsMethod · 0.80
get_nodeMethod · 0.45
connectMethod · 0.45
fundchannelMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected