mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
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:
parent
4e30a82f09
commit
d19cddf00f
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue