1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00

Fix trezorctl for protobuf changes in 0.11.2 (#365)

ethereum-sign-message     Leave `address` as text instead of encoding.
  ethereum-verify-message   Leave `address` as text instead of encoding.
  ethereum-sign-tx          Leave `to` as text instead of encoding.
This commit is contained in:
brianddk 2019-03-07 06:47:08 -06:00 committed by matejcik
parent a30586647a
commit 302b9d99e6

View File

@ -1041,7 +1041,7 @@ def ethereum_sign_message(connect, address, message):
ret = ethereum.sign_message(client, address_n, message) ret = ethereum.sign_message(client, address_n, message)
output = { output = {
"message": message, "message": message,
"address": "0x%s" % ret.address.hex(), "address": ret.address,
"signature": "0x%s" % ret.signature.hex(), "signature": "0x%s" % ret.signature.hex(),
} }
return output return output
@ -1060,7 +1060,6 @@ def ethereum_decode_hex(value):
@click.argument("message") @click.argument("message")
@click.pass_obj @click.pass_obj
def ethereum_verify_message(connect, address, signature, message): def ethereum_verify_message(connect, address, signature, message):
address = ethereum_decode_hex(address)
signature = ethereum_decode_hex(signature) signature = ethereum_decode_hex(signature)
return ethereum.verify_message(connect(), address, signature, message) return ethereum.verify_message(connect(), address, signature, message)
@ -1263,7 +1262,7 @@ def ethereum_sign_tx(
client = connect() client = connect()
address_n = tools.parse_path(address) address_n = tools.parse_path(address)
address = "0x%s" % ethereum.get_address(client, address_n).hex() address = ethereum.get_address(client, address_n)
if gas_price is None or gas_limit is None or nonce is None or publish: if gas_price is None or gas_limit is None or nonce is None or publish:
host, port = host.split(":") host, port = host.split(":")
@ -1294,7 +1293,7 @@ def ethereum_sign_tx(
nonce=nonce, nonce=nonce,
gas_price=gas_price, gas_price=gas_price,
gas_limit=gas_limit, gas_limit=gas_limit,
to=to_address, to=to,
value=value, value=value,
data=data, data=data,
chain_id=chain_id, chain_id=chain_id,