From 96702e1b57700a49b92ca44562003ff7c9446416 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 6 Apr 2022 13:49:08 +0930 Subject: [PATCH] command: add overlength test Signed-off-by: Rusty Russell --- commando/test_commando.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/commando/test_commando.py b/commando/test_commando.py index eb8c3985..e162ba8f 100755 --- a/commando/test_commando.py +++ b/commando/test_commando.py @@ -301,3 +301,18 @@ def test_readonly(node_factory): l1.rpc.commando(peer_id=l2.info['id'], rune=rrune, method='listdatastore') + + +def test_megacmd(node_factory): + l1, l2 = node_factory.line_graph(2, fundchannel=False, + opts={'plugin': [plugin_path, + datastore_path]}) + rrune = l2.rpc.commando_rune(restrictions='readonly')['rune'] + + # Proof that it got the rune: fails with "Unknown command" not "Not authorized" + with pytest.raises(RpcError, match='Unknown command'): + l1.rpc.call(method='commando', + payload={'peer_id': l2.info['id'], + 'method': 'get' + 'x' * 130000, + 'rune': rrune, + 'params': {}})