(node_factory)
| 2684 | |
| 2685 | |
| 2686 | def 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') |
nothing calls this directly
no test coverage detected