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

Function test_sendinvoice_blindedpath

tests/test_pay.py:5108–5123  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

5106
5107
5108def test_sendinvoice_blindedpath(node_factory, bitcoind):
5109 l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
5110 # We join l3->l1->l2 so l3 can pay invoice sent by l2.
5111 l3 = node_factory.get_node()
5112 node_factory.join_nodes([l3, l1], announce_channels=False)
5113
5114 # Make sure l3 knows l1, l2 is public, so it will create blinded path to it.
5115 wait_for(lambda: ['alias' in n for n in l3.rpc.listnodes()['nodes']] == [True, True])
5116
5117 invreq1 = l3.rpc.invoicerequest(amount='100000sat',
5118 description='test_sendinvoice_blindedpath')
5119 decode = l1.rpc.decode(invreq1['bolt12'])
5120 assert len(decode['invreq_paths']) == 1
5121 assert decode['invreq_paths'][0]['first_node_id'] == l1.info['id']
5122
5123 l2.rpc.sendinvoice(invreq=invreq1['bolt12'], label='test_sendinvoice_blindedpath 1')
5124
5125
5126def test_self_pay(node_factory):

Callers

nothing calls this directly

Calls 6

wait_forFunction · 0.90
line_graphMethod · 0.80
join_nodesMethod · 0.80
get_nodeMethod · 0.45
listnodesMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected