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

Function test_fetchinvoice_disconnected_reply

tests/test_pay.py:4943–4961  ·  view source on GitHub ↗

We ask for invoice, but reply path doesn't lead directly from recipient

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

4941
4942
4943def test_fetchinvoice_disconnected_reply(node_factory, bitcoind):
4944 """We ask for invoice, but reply path doesn't lead directly from recipient"""
4945 l1, l2, l3 = node_factory.get_nodes(3,
4946 opts={'may_reconnect': True,
4947 'dev-no-reconnect': None,
4948 'dev-allow-localhost': None})
4949 l3.rpc.connect(l2.info['id'], 'localhost', l2.port)
4950
4951 # Make l1, l2 public (so l3 can auto connect).
4952 node_factory.join_nodes([l1, l2], wait_for_announce=True)
4953 # Make sure l3 knows about l1's public address
4954 wait_for(lambda: ['addresses' in n for n in l3.rpc.listnodes()['nodes']] == [True] * 2)
4955
4956 offer = l3.rpc.offer(amount='5msat', description='test_fetchinvoice_disconnected_reply')
4957
4958 # l2 is already connected to l3, so it can fetch. It specifies a reply
4959 # path of l1->l2. l3 knows it can simply route reply to l1 via l2.
4960 l2.rpc.call('fetchinvoice', {'offer': offer['bolt12'], 'dev_reply_path': [l1.info['id'], l2.info['id']]})
4961 assert l3.rpc.listpeers(l1.info['id']) == {'peers': []}
4962
4963
4964def test_pay_blockheight_mismatch(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 8

wait_forFunction · 0.90
get_nodesMethod · 0.80
join_nodesMethod · 0.80
connectMethod · 0.45
listnodesMethod · 0.45
offerMethod · 0.45
callMethod · 0.45
listpeersMethod · 0.45

Tested by

no test coverage detected