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

use implicit encoding in encode/decode

This commit is contained in:
Pavol Rusnak 2018-09-06 16:16:10 +02:00
parent 843facd2c1
commit 22b18046c1
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -417,7 +417,7 @@ def coindef_from_dict(coin):
if val is None and fflags & protobuf.FLAG_REPEATED:
val = []
elif fname == "signed_message_header":
val = val.encode("utf-8")
val = val.encode()
elif fname == "hash_genesis_block":
val = binascii.unhexlify(val)
setattr(proto, fname, val)
@ -587,7 +587,7 @@ def coindefs(outfile):
icon = Image.open(coin["icon"])
ser = serialize_coindef(coindef_from_dict(coin), convert_icon(icon))
sig = sign(ser)
definition = binascii.hexlify(sig + ser).decode("ascii")
definition = binascii.hexlify(sig + ser).decode()
coindefs[key] = definition
with outfile: