donations: make option donations-autostart bool and donations-web-port int
Some checks failed
Integration Tests (latest) / Test CLN=25.12, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=25.12, PY=3.14, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.04, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.04, PY=3.14, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.06.1, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.06.1, PY=3.14, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / CI completion (push) Has been cancelled
Integration Tests (latest) / CI completion-1 (push) Has been cancelled
Integration Tests (latest) / CI completion-2 (push) Has been cancelled

This commit is contained in:
daywalker90 2026-06-26 15:21:41 +02:00
parent 9ff215d936
commit ea90b54d55
2 changed files with 18 additions and 4 deletions

View file

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

View file

@ -11,13 +11,21 @@ plugin_path = os.path.join(os.path.dirname(__file__), "donations.py")
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):