From d61bf7c63b7971bd9057f21cd15f07dc1acfa1e0 Mon Sep 17 00:00:00 2001 From: darosior Date: Tue, 24 Dec 2019 23:27:47 +0100 Subject: [PATCH] plugin_control: more descriptive key for 'plugin stop' result --- lightningd/plugin_control.c | 2 +- tests/test_plugin.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lightningd/plugin_control.c b/lightningd/plugin_control.c index af4506bcb23b..60d365b2951c 100644 --- a/lightningd/plugin_control.c +++ b/lightningd/plugin_control.c @@ -206,7 +206,7 @@ plugin_dynamic_stop(struct command *cmd, const char *plugin_name) plugin_kill(p, "%s stopped by lightningd via RPC", plugin_name); tal_free(p); response = json_stream_success(cmd); - json_add_string(response, "", + json_add_string(response, "result", take(tal_fmt(NULL, "Successfully stopped %s.", plugin_name))); return command_success(cmd, response); diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 4a22174da326..fb0e76a14256 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -127,7 +127,8 @@ def test_plugin_command(node_factory): n.rpc.plugin_list() # Make sure the plugin behaves normally after stop and restart - assert("Successfully stopped helloworld.py." == n.rpc.plugin_stop(plugin="helloworld.py")['']) + assert("Successfully stopped helloworld.py." == + n.rpc.plugin_stop(plugin="helloworld.py")["result"]) n.daemon.wait_for_log(r"Killing plugin: helloworld.py") n.rpc.plugin_start(plugin=os.path.join(os.getcwd(), "contrib/plugins/helloworld.py")) n.daemon.wait_for_log(r"Plugin helloworld.py initialized")