mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
pyln: add context manager to simpify filter use.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: pyln: LightningRpc has new `reply_filter` context manager for reducing output of RPC commands.
This commit is contained in:
@@ -705,7 +705,8 @@ class PrettyPrintingLightningRpc(LightningRpc):
|
||||
"result": res
|
||||
}, indent=2))
|
||||
|
||||
if schemas and schemas[1] and not filter:
|
||||
# FIXME: if filter set, just remove "required" from schemas?
|
||||
if schemas and schemas[1] and filter is None and self._filter is None:
|
||||
schemas[1].validate(res)
|
||||
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user