diff --git a/tools/coin_info.py b/tools/coin_info.py index 74d9d2c1b0..4f7d82c3c0 100755 --- a/tools/coin_info.py +++ b/tools/coin_info.py @@ -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"]), ) diff --git a/tools/cointool.py b/tools/cointool.py index 6bb43a9b88..c00b8f9612 100755 --- a/tools/cointool.py +++ b/tools/cointool.py @@ -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: