From 03b214a9d2d519675e539a2033b29e77f3fd34a9 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Mon, 16 Jan 2017 14:05:16 -0500 Subject: [PATCH] convert claim_out['fee'] to float --- lbrynet/core/Wallet.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 65e8924e1..9fbd68364 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -604,6 +604,12 @@ class Wallet(object): meta_for_return[k] = new_metadata[k] return defer.succeed(Metadata(meta_for_return)) + + def _process_claim_out(self, claim_out): + claim_out.pop('success') + claim_out['fee'] = float(claim_out['fee']) + return claim_out + """ Claim a name, update if name already claimed by user @param name: name to claim @@ -624,7 +630,7 @@ class Wallet(object): if not claim_out['success']: msg = 'Claim to name {} failed: {}'.format(name, claim_out['reason']) raise Exception(msg) - claim_out.pop('success') + claim_out = self._process_claim_out(claim_out) claim_outpoint = ClaimOutpoint(claim_out['txid'], claim_out['nout']) log.info("Saving metadata for claim %s %d", claim_outpoint['txid'], claim_outpoint['nout']) @@ -658,7 +664,7 @@ class Wallet(object): if not claim_out['success']: msg = 'Abandon of {}:{} failed: {}'.format(txid, nout, claim_out['resason']) raise Exception(msg) - claim_out.pop('success') + claim_out = self._process_claim_out(claim_out) return defer.succeed(claim_out) claim_outpoint = ClaimOutpoint(txid, nout) @@ -671,7 +677,7 @@ class Wallet(object): if not claim_out['success']: msg = 'Support of {}:{} failed: {}'.format(name, claim_id, claim_out['reason']) raise Exception(msg) - claim_out.pop('success') + claim_out = self._process_claim_out(claim_out) return defer.succeed(claim_out) d = self._support_claim(name, claim_id, amount)