From a936782ddcac60d8dda7cc3ec8094dfd8be674c7 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 24 Sep 2016 00:58:54 -0400 Subject: [PATCH] fix amount formatting between get_claim_info and get_my_claim --- lbrynet/core/LBRYWallet.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lbrynet/core/LBRYWallet.py b/lbrynet/core/LBRYWallet.py index 7280c67ef..6535e6e35 100644 --- a/lbrynet/core/LBRYWallet.py +++ b/lbrynet/core/LBRYWallet.py @@ -369,11 +369,17 @@ class LBRYWallet(object): return d def get_my_claim(self, name): + def _convert_units(claim): + amount = Decimal(claim['nEffectiveAmount'] / COIN) + claim['nEffectiveAmount'] = amount + return claim + def _get_claim_for_return(claim): if not claim: return False d = self.get_claim(name, claim['claim_id']) - d.addCallback(lambda c: self._format_claim_for_return(name, c, claim['txid'])) + d.addCallback(_convert_units) + d.addCallback(lambda clm: self._format_claim_for_return(name, clm, claim['txid'])) return d def _get_my_unspent_claim(claims): @@ -399,7 +405,7 @@ class LBRYWallet(object): def _format_claim_for_return(self, name, claim, txid, metadata=None, meta_version=None): result = {} result['claim_id'] = claim['claimId'] - result['amount'] = Decimal(claim['nEffectiveAmount'] / COIN) + result['amount'] = claim['nEffectiveAmount'] result['height'] = claim['nHeight'] result['name'] = name result['txid'] = txid