This commit is contained in:
Lex Berezhny 2018-10-17 21:10:23 -04:00
parent 73bd76b631
commit 4c4d652f1b
2 changed files with 4 additions and 6 deletions

View file

@ -67,6 +67,7 @@ class JSONResponseEncoder(JSONEncoder):
if claim.has_signature: if claim.has_signature:
output['valid_signature'] = None output['valid_signature'] = None
if txo.channel is not None: if txo.channel is not None:
output['channel_name'] = txo.channel.claim_name
output['valid_signature'] = claim.validate_signature( output['valid_signature'] = claim.validate_signature(
txo.get_address(self.ledger), txo.channel.claim txo.get_address(self.ledger), txo.channel.claim
) )
@ -80,9 +81,6 @@ class JSONResponseEncoder(JSONEncoder):
else: else:
output['type'] = 'basic' output['type'] = 'basic'
# deprecated, will be removed after 0.30 release
output['category'] = output['type']
return output return output
def encode_input(self, txi): def encode_input(self, txi):

View file

@ -288,14 +288,14 @@ class LbryWalletManager(BaseWalletManager):
txs = await account.get_transactions(**constraints) txs = await account.get_transactions(**constraints)
history = [] history = []
for tx in txs: for tx in txs:
ts = headers[tx.height]['timestamp'] ts = headers[tx.height]['timestamp'] if tx.height > 0 else None
item = { item = {
'txid': tx.id, 'txid': tx.id,
'timestamp': ts, 'timestamp': ts,
'value': dewies_to_lbc(tx.net_account_balance), 'value': dewies_to_lbc(tx.net_account_balance),
'fee': dewies_to_lbc(tx.fee), 'fee': dewies_to_lbc(tx.fee),
'date': datetime.fromtimestamp(ts).isoformat(' ')[:-3], 'date': datetime.fromtimestamp(ts).isoformat(' ')[:-3] if tx.height > 0 else None,
'confirmations': headers.height - tx.height, 'confirmations': headers.height - tx.height if tx.height > 0 else 0,
'claim_info': [{ 'claim_info': [{
'address': txo.get_address(account.ledger), 'address': txo.get_address(account.ledger),
'balance_delta': dewies_to_lbc(-txo.amount), 'balance_delta': dewies_to_lbc(-txo.amount),