mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 11:21:11 +00:00
tools: drop binascii usage
This commit is contained in:
parent
eca9402772
commit
23b07f975d
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
from binascii import unhexlify
|
||||
from collections import defaultdict, OrderedDict
|
||||
import re
|
||||
import os
|
||||
@ -232,7 +231,7 @@ def _load_erc20_tokens():
|
||||
token.update(
|
||||
chain=chain,
|
||||
chain_id=network["chain_id"],
|
||||
address_bytes=unhexlify(token["address"][2:]),
|
||||
address_bytes=bytes.fromhex(token["address"][2:]),
|
||||
shortcut=token["symbol"],
|
||||
key="erc20:{}:{}".format(chain, token["symbol"]),
|
||||
)
|
||||
|
@ -6,7 +6,6 @@ import re
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
import binascii
|
||||
import struct
|
||||
import zlib
|
||||
from collections import defaultdict
|
||||
@ -430,7 +429,7 @@ def coindef_from_dict(coin):
|
||||
elif fname == "signed_message_header":
|
||||
val = val.encode()
|
||||
elif fname == "hash_genesis_block":
|
||||
val = binascii.unhexlify(val)
|
||||
val = bytes.fromhex(val)
|
||||
setattr(proto, fname, val)
|
||||
|
||||
return proto
|
||||
@ -629,7 +628,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()
|
||||
definition = (sig + ser).hex()
|
||||
coindefs[key] = definition
|
||||
|
||||
with outfile:
|
||||
|
Loading…
Reference in New Issue
Block a user