mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 17:38:39 +00:00
use implicit encoding in encode/decode
This commit is contained in:
parent
843facd2c1
commit
22b18046c1
@ -417,7 +417,7 @@ def coindef_from_dict(coin):
|
|||||||
if val is None and fflags & protobuf.FLAG_REPEATED:
|
if val is None and fflags & protobuf.FLAG_REPEATED:
|
||||||
val = []
|
val = []
|
||||||
elif fname == "signed_message_header":
|
elif fname == "signed_message_header":
|
||||||
val = val.encode("utf-8")
|
val = val.encode()
|
||||||
elif fname == "hash_genesis_block":
|
elif fname == "hash_genesis_block":
|
||||||
val = binascii.unhexlify(val)
|
val = binascii.unhexlify(val)
|
||||||
setattr(proto, fname, val)
|
setattr(proto, fname, val)
|
||||||
@ -587,7 +587,7 @@ def coindefs(outfile):
|
|||||||
icon = Image.open(coin["icon"])
|
icon = Image.open(coin["icon"])
|
||||||
ser = serialize_coindef(coindef_from_dict(coin), convert_icon(icon))
|
ser = serialize_coindef(coindef_from_dict(coin), convert_icon(icon))
|
||||||
sig = sign(ser)
|
sig = sign(ser)
|
||||||
definition = binascii.hexlify(sig + ser).decode("ascii")
|
definition = binascii.hexlify(sig + ser).decode()
|
||||||
coindefs[key] = definition
|
coindefs[key] = definition
|
||||||
|
|
||||||
with outfile:
|
with outfile:
|
||||||
|
Loading…
Reference in New Issue
Block a user