From c0069d8944af1176d34ed5e4cbeccd0c6f7fac35 Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Tue, 3 Sep 2019 12:35:23 +0200 Subject: [PATCH] pylightning: adds Millisatoshi __radd__ method for sum() --- contrib/pylightning/lightning/lightning.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/pylightning/lightning/lightning.py b/contrib/pylightning/lightning/lightning.py index 8eb99b22e..9e505d368 100644 --- a/contrib/pylightning/lightning/lightning.py +++ b/contrib/pylightning/lightning/lightning.py @@ -157,6 +157,9 @@ class Millisatoshi: def __mod__(self, other): return Millisatoshi(int(self) % other) + def __radd__(self, other): + return Millisatoshi(int(self) + int(other)) + class UnixDomainSocketRpc(object): def __init__(self, socket_path, executor=None, logger=logging, encoder_cls=json.JSONEncoder, decoder=json.JSONDecoder()):