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

Function test_blindedpath_noaddr

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

Source from the content-addressed store, hash-verified

5916
5917
5918def test_blindedpath_noaddr(node_factory, bitcoind):
5919 l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
5920 opts={'dev-allow-localhost': None})
5921
5922 # Another channel.
5923 l3 = node_factory.get_node()
5924
5925 node_factory.join_nodes([l2, l3], wait_for_announce=True)
5926 # Make sure l3 knows about l1-l2, so will add route hint.
5927 wait_for(lambda: l3.rpc.listnodes(l1.info['id']) != {'nodes': []})
5928
5929 offer = l3.rpc.offer(1000, 'test_pay_blindedpath_nodeaddr')
5930 assert only_one(l1.rpc.decode(offer['bolt12'])['offer_paths'])['first_node_id'] == l2.info['id']
5931
5932 # But l2 has a public address, so doesn't bother.
5933 offer = l2.rpc.offer(1000, 'test_pay_blindedpath_nodeaddr')
5934 assert 'offer_paths' not in l1.rpc.decode(offer['bolt12'])
5935
5936 # If l2 is disconnected, l3 will *not* add a blinded path.
5937 l2.rpc.disconnect(l3.info['id'], force=True)
5938 offer = l3.rpc.offer(1000, 'test_pay_blindedpath_nodeaddr2')
5939 assert 'offer_paths' not in l1.rpc.decode(offer['bolt12'])
5940
5941
5942def test_blinded_reply_path_scid(node_factory):

Callers

nothing calls this directly

Calls 9

wait_forFunction · 0.90
only_oneFunction · 0.90
line_graphMethod · 0.80
join_nodesMethod · 0.80
get_nodeMethod · 0.45
listnodesMethod · 0.45
offerMethod · 0.45
decodeMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected