From 63f8b740268792d10475bdc8d203f50fa1641583 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Tue, 6 Sep 2022 11:43:46 +0000 Subject: [PATCH] pyln-client: add patch that fixes plugins Without this patch, the summary and feeadjuster plugins crash on startup. --- pkgs/python-packages/pyln-client/default.nix | 8 ++++++++ pkgs/python-packages/pyln-client/msat-null.patch | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/python-packages/pyln-client/msat-null.patch diff --git a/pkgs/python-packages/pyln-client/default.nix b/pkgs/python-packages/pyln-client/default.nix index 99e1a2c..afc7798 100644 --- a/pkgs/python-packages/pyln-client/default.nix +++ b/pkgs/python-packages/pyln-client/default.nix @@ -16,5 +16,13 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook ]; + # TODO-EXTERNAL: + # This patch is a variant (fixed relative path) of + # https://github.com/ElementsProject/lightning/pull/5574. This is already + # fixed upstream. Remove this after the next clightning release. + patches = [ + ./msat-null.patch + ]; + postUnpack = "sourceRoot=$sourceRoot/contrib/${pname}"; } diff --git a/pkgs/python-packages/pyln-client/msat-null.patch b/pkgs/python-packages/pyln-client/msat-null.patch new file mode 100644 index 0000000..ee3c611 --- /dev/null +++ b/pkgs/python-packages/pyln-client/msat-null.patch @@ -0,0 +1,16 @@ +diff --git a/pyln/client/lightning.py b/pyln/client/lightning.py +index 38fc7563f..0013b89a3 100644 +--- a/pyln/client/lightning.py ++++ b/pyln/client/lightning.py +@@ -455,6 +455,11 @@ class LightningRpc(UnixDomainSocketRpc): + if k.endswith('msat'): + if isinstance(v, list): + obj[k] = [Millisatoshi(e) for e in v] ++ # FIXME: Deprecated "listconfigs" gives two 'null' fields: ++ # "lease-fee-base-msat": null, ++ # "channel-fee-max-base-msat": null, ++ elif v is None: ++ obj[k] = None + else: + obj[k] = Millisatoshi(v) + else: