mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
common: remove support for pre v0.10.2 onionmessages.
Temporarily disable sendpay_blinding test which uses obsolete onionmsg; there's still some debate on the PR about how blinded HTLCs will work. Changelog-EXPERIMENTAL: onionmessage: removed support for v0.10.1 onion messages. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -2252,77 +2252,6 @@ def test_sendcustommsg(node_factory):
|
||||
])
|
||||
|
||||
|
||||
def test_sendobsonionmessage(node_factory):
|
||||
l1, l2, l3 = node_factory.line_graph(3, opts={'experimental-onion-messages': None})
|
||||
|
||||
blindedpathtool = os.path.join(os.path.dirname(__file__), "..", "devtools", "blindedpath")
|
||||
|
||||
l1.rpc.call('sendobsonionmessage',
|
||||
{'hops':
|
||||
[{'id': l2.info['id']},
|
||||
{'id': l3.info['id']}]})
|
||||
assert l3.daemon.wait_for_log('Got obsolete onionmsg')
|
||||
|
||||
# Now by SCID.
|
||||
l1.rpc.call('sendobsonionmessage',
|
||||
{'hops':
|
||||
[{'id': l2.info['id'],
|
||||
'short_channel_id': l2.get_channel_scid(l3)},
|
||||
{'id': l3.info['id']}]})
|
||||
assert l3.daemon.wait_for_log('Got obsolete onionmsg')
|
||||
|
||||
# Now test blinded path.
|
||||
output = subprocess.check_output(
|
||||
[blindedpathtool, '--simple-output', 'create', l2.info['id'], l3.info['id']]
|
||||
).decode('ASCII').strip()
|
||||
|
||||
# First line is blinding, then <peerid> then <encblob>.
|
||||
blinding, p1, p1enc, p2 = output.split('\n')
|
||||
# First hop can't be blinded!
|
||||
assert p1 == l2.info['id']
|
||||
|
||||
l1.rpc.call('sendobsonionmessage',
|
||||
{'hops':
|
||||
[{'id': l2.info['id'],
|
||||
'blinding': blinding,
|
||||
'enctlv': p1enc},
|
||||
{'id': p2}]})
|
||||
assert l3.daemon.wait_for_log('Got obsolete onionmsg')
|
||||
|
||||
|
||||
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "Needs sendobsonionmessage")
|
||||
def test_sendobsonionmessage_reply(node_factory):
|
||||
blindedpathtool = os.path.join(os.path.dirname(__file__), "..", "devtools", "blindedpath")
|
||||
|
||||
plugin = os.path.join(os.path.dirname(__file__), "plugins", "onionmessage-reply.py")
|
||||
l1, l2, l3 = node_factory.line_graph(3, opts={'plugin': plugin})
|
||||
|
||||
# Make reply path
|
||||
output = subprocess.check_output(
|
||||
[blindedpathtool, '--simple-output', 'create', l2.info['id'], l1.info['id']]
|
||||
).decode('ASCII').strip()
|
||||
|
||||
# First line is blinding, then <peerid> then <encblob>.
|
||||
blinding, p1, p1enc, p2 = output.split('\n')
|
||||
# First hop can't be blinded!
|
||||
assert p1 == l2.info['id']
|
||||
|
||||
# Also tests oversize payload which won't fit in 1366-byte onion.
|
||||
l1.rpc.call('sendobsonionmessage',
|
||||
{'hops':
|
||||
[{'id': l2.info['id']},
|
||||
{'id': l3.info['id'],
|
||||
'invoice': '77' * 15000}],
|
||||
'reply_path':
|
||||
{'blinding': blinding,
|
||||
'path': [{'id': p1, 'enctlv': p1enc}, {'id': p2}]}})
|
||||
|
||||
assert l3.daemon.wait_for_log('Got obsolete onionmsg reply_blinding reply_path')
|
||||
assert l3.daemon.wait_for_log("Got onion_message invoice '{}'".format('77' * 15000))
|
||||
assert l3.daemon.wait_for_log('Sent reply via')
|
||||
assert l1.daemon.wait_for_log('Got obsolete onionmsg')
|
||||
|
||||
|
||||
@pytest.mark.developer("needs --dev-force-privkey")
|
||||
def test_getsharedsecret(node_factory):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user