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

style: drop tokens.py from style checks

because pyflakes / stdlib's ast will exceed recursion depth
while analyzing the main function
This commit is contained in:
matejcik 2019-05-22 15:06:23 +02:00
parent a997ee5f5f
commit 984c6b6236
2 changed files with 5 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# generated from tokens.py.mako # generated from tokens.py.mako
# do not edit manually! # do not edit manually!
# flake8: noqa
# fmt: off
UNKNOWN_TOKEN = (None, None, None, None) UNKNOWN_TOKEN = (None, None, None, None)
@ -9,7 +9,6 @@ UNKNOWN_TOKEN = (None, None, None, None)
def token_by_chain_address(chain_id, address): def token_by_chain_address(chain_id, address):
if False: if False:
pass pass
# fmt: off
elif chain_id == 1: elif chain_id == 1:
if False: if False:
pass pass
@ -2293,5 +2292,4 @@ def token_by_chain_address(chain_id, address):
return (chain_id, address, "DGT", 0) # esn / DGT return (chain_id, address, "DGT", 0) # esn / DGT
elif address == b"\x01\x46\xb9\xdc\xd9\xfb\x2a\xbc\x1b\x5b\x13\x6c\x28\xd2\x0d\x00\x37\x52\x69\x61": elif address == b"\x01\x46\xb9\xdc\xd9\xfb\x2a\xbc\x1b\x5b\x13\x6c\x28\xd2\x0d\x00\x37\x52\x69\x61":
return (chain_id, address, "TOPM", 18) # esn / TOPM return (chain_id, address, "TOPM", 18) # esn / TOPM
# fmt: on
return UNKNOWN_TOKEN return UNKNOWN_TOKEN

View File

@ -1,6 +1,7 @@
# generated from tokens.py.mako # generated from tokens.py.mako
# do not edit manually! # do not edit manually!
# flake8: noqa
# fmt: off
<% <%
from collections import defaultdict from collections import defaultdict
@ -9,7 +10,7 @@ def group_tokens(tokens):
for t in sorted(tokens, key=lambda t: t.chain_id): for t in sorted(tokens, key=lambda t: t.chain_id):
r[t.chain_id].append(t) r[t.chain_id].append(t)
return r return r
%> %>\
UNKNOWN_TOKEN = (None, None, None, None) UNKNOWN_TOKEN = (None, None, None, None)
@ -17,7 +18,6 @@ UNKNOWN_TOKEN = (None, None, None, None)
def token_by_chain_address(chain_id, address): def token_by_chain_address(chain_id, address):
if False: if False:
pass pass
# fmt: off
% for token_chain_id, tokens in group_tokens(supported_on("trezor2", erc20)).items(): % for token_chain_id, tokens in group_tokens(supported_on("trezor2", erc20)).items():
elif chain_id == ${token_chain_id}: elif chain_id == ${token_chain_id}:
if False: if False:
@ -27,5 +27,4 @@ def token_by_chain_address(chain_id, address):
return (chain_id, address, ${black_repr(t.symbol)}, ${t.decimals}) # ${t.chain} / ${t.name.strip()} return (chain_id, address, ${black_repr(t.symbol)}, ${t.decimals}) # ${t.chain} / ${t.name.strip()}
% endfor % endfor
% endfor % endfor
# fmt: on
return UNKNOWN_TOKEN return UNKNOWN_TOKEN