コード例 #1
0
ファイル: LBRYWallet.py プロジェクト: Xuiquaxa/lbry
 def _decode(raw_tx):
     tx = Transaction(raw_tx).deserialize()
     decoded_tx = {}
     for txkey in tx.keys():
         if isinstance(tx[txkey], list):
             decoded_tx[txkey] = []
             for i in tx[txkey]:
                 tmp = {}
                 for k in i.keys():
                     if isinstance(i[k], Decimal):
                         tmp[k] = float(i[k] / 1e8)
                     else:
                         tmp[k] = i[k]
                 decoded_tx[txkey].append(tmp)
         else:
             decoded_tx[txkey] = tx[txkey]
     return decoded_tx