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

Function test_closing_disconnected_notify

tests/test_closing.py:160–177  ·  view source on GitHub ↗
(node_factory, bitcoind, executor)

Source from the content-addressed store, hash-verified

158
159
160def test_closing_disconnected_notify(node_factory, bitcoind, executor):
161 l1, l2 = node_factory.line_graph(2)
162
163 l1.pay(l2, 200000000)
164 l2.stop()
165 # Wait until channeld is definitely gone.
166 wait_for(lambda: 'owner' not in only_one(l1.rpc.listpeerchannels()['channels']))
167
168 out = subprocess.check_output(['cli/lightning-cli',
169 '--network={}'.format(TEST_NETWORK),
170 '--lightning-dir={}'
171 .format(l1.daemon.lightning_dir),
172 'close',
173 l2.info['id'],
174 '5']).decode('utf-8').splitlines()
175 assert out[0] == '# peer is offline, will negotiate once they reconnect (5 seconds before unilateral close).'
176 assert out[1] == '# Timed out, forcing close.'
177 assert not any([line.startswith('#') for line in out[2:]])
178
179
180def test_closing_id(node_factory):

Callers

nothing calls this directly

Calls 8

wait_forFunction · 0.90
only_oneFunction · 0.90
line_graphMethod · 0.80
listpeerchannelsMethod · 0.80
anyClass · 0.50
payMethod · 0.45
stopMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected