diff --git a/donations/donations.py b/donations/donations.py index ff3e7c62f..972eb2dd5 100755 --- a/donations/donations.py +++ b/donations/donations.py @@ -255,11 +255,17 @@ def donationserver(command="start", port=8088): plugin.add_option( - "donations-autostart", "true", "Should the donation server start automatically" + "donations-autostart", + True, + "Should the donation server start automatically", + "bool", ) plugin.add_option( - "donations-web-port", "8088", "Which port should the donation server listen to?" + "donations-web-port", + 8088, + "Which port should the donation server listen to?", + "int", ) @@ -267,7 +273,7 @@ def donationserver(command="start", port=8088): def init(options, configuration, plugin): port = int(options["donations-web-port"]) - if options["donations-autostart"].lower() in ["true", "1"]: + if options["donations-autostart"]: start_server(port) diff --git a/donations/test_donations.py b/donations/test_donations.py index 4e38fb0e7..ce6db9d93 100644 --- a/donations/test_donations.py +++ b/donations/test_donations.py @@ -11,13 +11,21 @@ def test_donation_starts(node_factory): l1 = node_factory.get_node() # Test dynamically - l1.rpc.plugin_start(plugin_path) + l1.rpc.plugin_start(plugin_path, **{"donations-web-port": 8089}) + l1.daemon.logsearch_start = 0 + l1.daemon.wait_for_log( + "plugin-donations.py:.*Starting donation server on port 8089 on all addresses" + ) l1.rpc.plugin_stop(plugin_path) l1.rpc.plugin_start(plugin_path) l1.stop() # Then statically l1.daemon.opts["plugin"] = plugin_path l1.start() + l1.daemon.logsearch_start = 0 + l1.daemon.wait_for_log( + "plugin-donations.py:.*Starting donation server on port 8088 on all addresses" + ) def test_donation_server(node_factory): diff --git a/summary/summary.py b/summary/summary.py index 867ef68bc..e28e82bf0 100755 --- a/summary/summary.py +++ b/summary/summary.py @@ -395,6 +395,7 @@ def on_rpc_command_callback(plugin, **kwargs): "summary-availability-window", 72, "How many hours the availability should be averaged over.", + "int", ) plugin.add_option( "summary-sortkey",