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

Function test_private_channel

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

Source from the content-addressed store, hash-verified

2414@pytest.mark.openchannel('v1')
2415@pytest.mark.openchannel('v2')
2416def test_private_channel(node_factory):
2417 l1, l2 = node_factory.line_graph(2, announce_channels=False, wait_for_announce=False)
2418 l3, l4 = node_factory.line_graph(2, announce_channels=True, wait_for_announce=True)
2419
2420 assert l1.daemon.is_in_log('Will open private channel with node {}'.format(l2.info['id']))
2421 assert not l2.daemon.is_in_log('Will open private channel with node {}'.format(l1.info['id']))
2422 assert not l3.daemon.is_in_log('Will open private channel with node {}'.format(l4.info['id']))
2423
2424 l3.daemon.wait_for_log('Received node_announcement for node {}'.format(l4.info['id']))
2425 l4.daemon.wait_for_log('Received node_announcement for node {}'.format(l3.info['id']))
2426
2427 assert not l1.daemon.is_in_log('Received node_announcement for node {}'.format(l2.info['id']))
2428 assert not l2.daemon.is_in_log('Received node_announcement for node {}'.format(l1.info['id']))
2429
2430 # test for 'private' flag in rpc output
2431 assert only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['private']
2432 # check non-private channel
2433 assert not only_one(l4.rpc.listpeerchannels(l3.info['id'])['channels'])['private']
2434
2435
2436def test_channel_reenable(node_factory):

Callers

nothing calls this directly

Calls 5

only_oneFunction · 0.90
line_graphMethod · 0.80
is_in_logMethod · 0.80
wait_for_logMethod · 0.80
listpeerchannelsMethod · 0.80

Tested by

no test coverage detected