core-lightning/tests/plugins/clnrest-use-options.py
Rusty Russell eae0d1da1e lightningd: fix up deprecated rest-port, rest-protocol, rest-host and rest-certs option if we would otherwise fail.
Since these worked in v23.08, we can't just rename them.  So if they are
used and unclaimed, we should rename them internally (if they're claimed,
it's probably clightning-rest, and we should *NOT* touch them!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: Plugins: `clnrest` parameters `rest-port`, `rest-protocol`, `rest-host` and `rest-certs`: prefix `cln` to them
2023-11-17 10:51:41 +01:00

18 lines
358 B
Python
Executable file

#!/usr/bin/env python3
"""Register rest-port to test that we don't "fix" it."""
from pyln.client import Plugin
plugin = Plugin()
@plugin.init()
def init(configuration, options, plugin):
print(f"rest-port is {plugin.get_option('rest-port')}")
plugin.add_option('rest-port', None, "Parameter to clash with clnrest.py deprecated one")
plugin.run()