trezorctl: fix hexlify calls on python3

pull/25/head
Pavol Rusnak 7 years ago
parent e3c7146a80
commit a4a7aa8d85
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -0,0 +1 @@
{"txid": "d2dcdaf547ea7f57a713c607f15e883ddc4a98167ee2c43ed953c53cb5153e24", "version": 1, "locktime": 0, "vin": [{"txid": "4e686d9815219fc2e57baae29c3b44567693b96fbe150550c269786fbbc6d653", "vout": 0, "sequence": 4294967295, "n": 0, "scriptSig": {"hex": "160014e31581ae69eca39192917940e6604fe6546441c0", "asm": "0014e31581ae69eca39192917940e6604fe6546441c0"}, "addr": "2N2Bw4ofaXx79bEdmG556FMGqa2EWmzJKr8", "valueSat": 2870562139, "value": 28.70562139, "doubleSpentTxID": null}], "vout": [{"value": "27.47158341", "n": 0, "scriptPubKey": {"hex": "a914f96f26251d4edd4c915aa76885dc0a91ec83df1087", "asm": "OP_HASH160 f96f26251d4edd4c915aa76885dc0a91ec83df10 OP_EQUAL", "addresses": ["2NFz7PpPg58HExT4stQDFoqpqduKaiwApqu"], "type": "scripthash"}, "spentTxId": "fe26bc077de27b72ffc5ce77a7e296c7c855b7deb3dec72a3f82c0c07c722bb0", "spentIndex": 0, "spentHeight": 1155197}, {"value": "1.23400000", "n": 1, "scriptPubKey": {"hex": "76a9145740ddea127387c6650ab531994fe6a29b0cec3388ac", "asm": "OP_DUP OP_HASH160 5740ddea127387c6650ab531994fe6a29b0cec33 OP_EQUALVERIFY OP_CHECKSIG", "addresses": ["moUJnmge8SRXuediK7bW6t4YfrPqbE6hD7"], "type": "pubkeyhash"}, "spentTxId": null, "spentIndex": null, "spentHeight": null}], "blockhash": "000000000000061da5f05a6cfbe100b95895e42878d479c30b0f7c1ebfe786ed", "blockheight": 1155197, "confirmations": 23504, "time": 1501158191, "blocktime": 1501158191, "valueOut": 28.70558341, "size": 140, "valueIn": 28.70562139, "fees": 3.798e-05}

@ -479,8 +479,8 @@ def ethereum_sign_message(client, address, message):
ret = client.ethereum_sign_message(address_n, message)
output = {
'message': message,
'address': '0x' + binascii.hexlify(ret.address).decode('ascii'),
'signature': '0x' + binascii.hexlify(ret.signature).decode('ascii')
'address': '0x%s' % binascii.hexlify(ret.address).decode(),
'signature': '0x%s' % binascii.hexlify(ret.signature).decode()
}
return output
@ -566,7 +566,7 @@ def decrypt_message(client, address, payload):
def ethereum_get_address(client, address, show_display):
address_n = client.expand_path(address)
address = client.ethereum_get_address(address_n, show_display)
return '0x%s' % binascii.hexlify(str(address))
return '0x%s' % binascii.hexlify(address).decode()
@cli.command(help='Sign (and optionally publish) Ethereum transaction. Use TO as destination address or set TO to "" for contract creation.')

Loading…
Cancel
Save