diff --git a/lightningd/plugin.c b/lightningd/plugin.c index f28ab277e..c72b62a47 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -1525,15 +1525,9 @@ plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req) continue; json_add_bool(req->stream, name, *opt->value->as_bool); - if (!deprecated_apis) - continue; - } - if (opt->value->as_int) { + } else if (opt->value->as_int) { json_add_s64(req->stream, name, *opt->value->as_int); - if (!deprecated_apis) - continue; - } - if (opt->value->as_str) { + } else if (opt->value->as_str) { json_add_string(req->stream, name, opt->value->as_str); } } diff --git a/tests/test_plugin.py b/tests/test_plugin.py index d04e28a52..debb158fe 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -52,7 +52,6 @@ def test_option_passthrough(node_factory, directory): n.stop() -@unittest.skipIf(DEPRECATED_APIS, "We test the new API.") def test_option_types(node_factory): """Ensure that desired types of options are respected in output """ @@ -121,25 +120,6 @@ def test_option_types(node_factory): assert not n.daemon.running assert n.daemon.is_in_stderr("--flag_opt: doesn't allow an argument") - plugin_path = os.path.join(os.getcwd(), 'tests/plugins/options.py') - n = node_factory.get_node(options={ - 'plugin': plugin_path, - 'str_opt': 'ok', - 'int_opt': 22, - 'bool_opt': 1, - 'flag_opt': None, - 'allow-deprecated-apis': True - }) - - # because of how the python json parser works, since we're adding the deprecated - # string option after the 'typed' option in the JSON, the string option overwrites - # the earlier typed option in JSON parsing, resulting in a option set of only strings - assert n.daemon.is_in_log(r"option str_opt ok ") - assert n.daemon.is_in_log(r"option int_opt 22 ") - assert n.daemon.is_in_log(r"option bool_opt 1 ") - assert n.daemon.is_in_log(r"option flag_opt True ") - n.stop() - def test_millisatoshi_passthrough(node_factory): """ Ensure that Millisatoshi arguments and return work.