mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +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:
committed by
Rusty Russell
parent
4e30a82f09
commit
d19cddf00f
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user