Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass typed plugin option data to plugin in init #3582

Merged
merged 7 commits into from
Mar 10, 2020
3 changes: 3 additions & 0 deletions contrib/pyln-client/pyln/client/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ def add_option(self, name, default, description, opt_type="string"):
"Name {} is already used by another option".format(name)
)

if opt_type not in ["string", "int", "bool"]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[commit msg]

not sure if this is totally necessary, should we jsut let clightning
enforce the input?

Might be a bit redundant but an advantage is that one can see its mistake just by trying its plugin with python3 myplugin.py..

raise ValueError('{} not in supported type set (string, int, bool)')

self.options[name] = {
'name': name,
'default': default,
Expand Down