Browse Source

pyln: enforce types of options

we loosely enforce that the specified type must be one of the listed
options. you can still cause an error because we're not checking the
default value you're passing in ...

not sure if this is totally necessary, should we jsut let clightning
enforce the input?
travis-debug
lisa neigut 5 years ago
committed by Rusty Russell
parent
commit
d19cddf00f
  1. 3
      contrib/pyln-client/pyln/client/plugin.py

3
contrib/pyln-client/pyln/client/plugin.py

@ -250,6 +250,9 @@ class Plugin(object):
"Name {} is already used by another option".format(name)
)
if opt_type not in ["string", "int", "bool"]:
raise ValueError('{} not in supported type set (string, int, bool)')
self.options[name] = {
'name': name,
'default': default,

Loading…
Cancel
Save