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

Function test_xpay_timeout

tests/test_xpay.py:337–356  ·  view source on GitHub ↗
(node_factory, executor)

Source from the content-addressed store, hash-verified

335
336
337def test_xpay_timeout(node_factory, executor):
338 # ->l3->
339 # l1->l2< >l4
340 # ->l5->
341 l1, l2, l3, l4, l5 = node_factory.get_nodes(5, opts={'dev-no-reconnect': None})
342
343 node_factory.join_nodes([l1, l2, l3, l4], wait_for_announce=True)
344 node_factory.join_nodes([l2, l5, l4], fundamount=FUNDAMOUNT // 2, wait_for_announce=True)
345
346 # Make sure l1 sees both paths.
347 wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 5 * 2)
348
349 # Break l3->l4
350 l3.rpc.disconnect(l4.info['id'], force=True)
351
352 b11 = l4.rpc.invoice('100000sat', 'test_xpay_timeout', 'test_xpay_timeout')['bolt11']
353 fut = executor.submit(l1.rpc.xpay, invstring=b11, retry_for=0)
354
355 with pytest.raises(RpcError, match=r"Timed out after after 1 attempts"):
356 fut.result(TIMEOUT)
357
358
359@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 6

wait_forFunction · 0.90
get_nodesMethod · 0.80
join_nodesMethod · 0.80
listchannelsMethod · 0.45
disconnectMethod · 0.45
invoiceMethod · 0.45

Tested by

no test coverage detected