fix get_my_claim command
This commit is contained in:
parent
28bf5215e4
commit
1f06339d5a
1 changed files with 2 additions and 9 deletions
|
@ -370,18 +370,11 @@ class Wallet(object):
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def get_my_claim(self, name):
|
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):
|
def _get_claim_for_return(claim):
|
||||||
if not claim:
|
if not claim:
|
||||||
return False
|
return False
|
||||||
d = self.get_claim(name, claim['claim_id'])
|
claim['value'] = json.loads(claim['value'])
|
||||||
d.addCallback(_convert_units)
|
return claim
|
||||||
d.addCallback(lambda clm: self._format_claim_for_return(name, clm, claim['txid']))
|
|
||||||
return d
|
|
||||||
|
|
||||||
def _get_my_unspent_claim(claims):
|
def _get_my_unspent_claim(claims):
|
||||||
for claim in claims:
|
for claim in claims:
|
||||||
|
|
Loading…
Reference in a new issue