From 8545ab880b4b74d9ddcf94a9c73799a9e60b439c Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sun, 12 Apr 2020 15:30:25 -0400 Subject: [PATCH] psycopg2 returns Decimal for SUM() --- lbry/wallet/dewies.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbry/wallet/dewies.py b/lbry/wallet/dewies.py index 8244712b5..ff0f52389 100644 --- a/lbry/wallet/dewies.py +++ b/lbry/wallet/dewies.py @@ -1,4 +1,5 @@ import textwrap +from decimal import Decimal from .util import coins_to_satoshis, satoshis_to_coins @@ -36,7 +37,7 @@ def dewies_to_lbc(dewies) -> str: def dict_values_to_lbc(d): lbc_dict = {} for key, value in d.items(): - if isinstance(value, int): + if isinstance(value, (int, Decimal)): lbc_dict[key] = dewies_to_lbc(value) elif isinstance(value, dict): lbc_dict[key] = dict_values_to_lbc(value)