From e3dfba89447f2f36f4de1fbd39a519530463f806 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Apr 2020 14:23:22 +1030 Subject: [PATCH] pytest: test sendonionmessage. Signed-off-by: Rusty Russell --- tests/test_misc.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_misc.py b/tests/test_misc.py index 5a34aaeeb..aecd96ae4 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -10,6 +10,7 @@ from pyln.testing.utils import ( TailableProc, env ) from ephemeral_port_reserve import reserve +from utils import EXPERIMENTAL_FEATURES import json import os @@ -2177,6 +2178,27 @@ def test_sendcustommsg(node_factory): serialized=serialized, peer_id=l2.info['id'])) +@unittest.skipIf(not EXPERIMENTAL_FEATURES, "Needs sendonionmessage") +def test_sendonionmessage(node_factory): + l1, l2, l3 = node_factory.line_graph(3) + + l1.rpc.call('sendonionmessage', + {'hops': + [{'id': l2.info['id']}, + {'id': l3.info['id']}]}) + assert l3.daemon.wait_for_log('Got onionmsg') + + # Now by SCID. + l1.rpc.call('sendonionmessage', + {'hops': + [{'id': l2.info['id'], + 'short_channel_id': l2.get_channel_scid(l3)}, + {'id': l3.info['id']}]}) + assert l3.daemon.wait_for_log('Got onionmsg') + + # FIXME: Test blinded path! + + @unittest.skipIf(not DEVELOPER, "needs --dev-force-privkey") def test_getsharedsecret(node_factory): """