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?
This commit is contained in:
lisa neigut 2020-03-07 18:11:32 -06:00 committed by Rusty Russell
parent 4e30a82f09
commit d19cddf00f

View file

@ -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,