From d19cddf00f405da11558795a4666abb0db7f211e Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Sat, 7 Mar 2020 18:11:32 -0600 Subject: [PATCH] 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? --- contrib/pyln-client/pyln/client/plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/pyln-client/pyln/client/plugin.py b/contrib/pyln-client/pyln/client/plugin.py index 5ed9ed0da..dbc1cbdd0 100644 --- a/contrib/pyln-client/pyln/client/plugin.py +++ b/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,