Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions donations/donations.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,25 @@ 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",
)


@plugin.init()
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)


Expand Down
10 changes: 9 additions & 1 deletion donations/test_donations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions summary/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down