1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

common/tools: do not auto-set duplicate for coin/token combination

Also update some auto-set dups to manually-set dups.
Leaving TRC token enabled because bitcoin:TRC is unsupported.
This commit is contained in:
matejcik 2019-04-29 19:08:11 +02:00
parent 4b407a9ac1
commit 8ddeff7598
2 changed files with 24 additions and 14 deletions

View File

@ -1277,7 +1277,7 @@
"erc20:eth:A18:bde8": "(AUTO) duplicate key",
"erc20:eth:ATH": "(AUTO) duplicate key",
"erc20:eth:ATH (AIgatha Token)": "(AUTO) duplicate key",
"erc20:eth:ATS": "(AUTO) duplicate key",
"erc20:eth:ATS": "duplicate key with eth:ATS",
"erc20:eth:BCAP:1f41": "(AUTO) duplicate key",
"erc20:eth:BCAP:ff35": "(AUTO) duplicate key",
"erc20:eth:BKB:5c39": "(AUTO) duplicate key",
@ -1305,7 +1305,7 @@
"erc20:eth:COIN:eb54": "(AUTO) duplicate key",
"erc20:eth:COSS:6529": "(AUTO) duplicate key",
"erc20:eth:COSS:9e96": "(AUTO) duplicate key",
"erc20:eth:CPC": "(AUTO) duplicate key",
"erc20:eth:CPC": "duplicate key with bitcoin:CPC",
"erc20:eth:CPT:88d5": "(AUTO) duplicate key",
"erc20:eth:CPT:9b62": "(AUTO) duplicate key",
"erc20:eth:DEPO": "(AUTO) duplicate key",
@ -1332,7 +1332,7 @@
"erc20:eth:FANX:7f67": "(AUTO) duplicate key",
"erc20:eth:FLMC:04cc": "(AUTO) duplicate key",
"erc20:eth:FLMC:5976": "(AUTO) duplicate key",
"erc20:eth:FTC": "(AUTO) duplicate key",
"erc20:eth:FTC": "duplicate key with bitcoin:FTC",
"erc20:eth:FUCK:65be": "(AUTO) duplicate key",
"erc20:eth:FUCK:ab16": "(AUTO) duplicate key",
"erc20:eth:FXC:4a57": "(AUTO) duplicate key",
@ -1386,7 +1386,7 @@
"erc20:eth:PRPS:7641": "(AUTO) duplicate key",
"erc20:eth:PRPS:d94f": "(AUTO) duplicate key",
"erc20:eth:PRPS:e40c": "(AUTO) duplicate key",
"erc20:eth:PTC": "(AUTO) duplicate key",
"erc20:eth:PTC": "duplicate key with bitcoin:PTC",
"erc20:eth:RCT:13f2": "(AUTO) duplicate key",
"erc20:eth:RCT:2a3a": "(AUTO) duplicate key",
"erc20:eth:RING:86e5": "(AUTO) duplicate key",
@ -1396,7 +1396,7 @@
"erc20:eth:SKRP:324a": "(AUTO) duplicate key",
"erc20:eth:SKRP:6e34": "(AUTO) duplicate key",
"erc20:eth:SKRP:fdfe": "(AUTO) duplicate key",
"erc20:eth:SMART": "(AUTO) duplicate key",
"erc20:eth:SMART": "duplicate key with bitcoin:SMART",
"erc20:eth:SMT:2dcf": "(AUTO) duplicate key",
"erc20:eth:SMT:55f9": "(AUTO) duplicate key",
"erc20:eth:SMT:78eb": "(AUTO) duplicate key",
@ -1408,7 +1408,6 @@
"erc20:eth:TIC:7243": "(AUTO) duplicate key",
"erc20:eth:TICO:7f4b": "(AUTO) duplicate key",
"erc20:eth:TICO:a5db": "(AUTO) duplicate key",
"erc20:eth:TRC": "(AUTO) duplicate key",
"erc20:eth:TRX": "switched to custom network",
"erc20:eth:UMKA:105d": "(AUTO) duplicate key",
"erc20:eth:UMKA:8e5a": "(AUTO) duplicate key",
@ -2628,7 +2627,7 @@
"erc20:eth:A18:bde8": "(AUTO) duplicate key",
"erc20:eth:ATH": "(AUTO) duplicate key",
"erc20:eth:ATH (AIgatha Token)": "(AUTO) duplicate key",
"erc20:eth:ATS": "(AUTO) duplicate key",
"erc20:eth:ATS": "duplicate key with eth:ATS",
"erc20:eth:BCAP:1f41": "(AUTO) duplicate key",
"erc20:eth:BCAP:ff35": "(AUTO) duplicate key",
"erc20:eth:BKB:5c39": "(AUTO) duplicate key",
@ -2656,7 +2655,7 @@
"erc20:eth:COIN:eb54": "(AUTO) duplicate key",
"erc20:eth:COSS:6529": "(AUTO) duplicate key",
"erc20:eth:COSS:9e96": "(AUTO) duplicate key",
"erc20:eth:CPC": "(AUTO) duplicate key",
"erc20:eth:CPC": "duplicate key with bitcoin:CPC",
"erc20:eth:CPT:88d5": "(AUTO) duplicate key",
"erc20:eth:CPT:9b62": "(AUTO) duplicate key",
"erc20:eth:DEPO": "(AUTO) duplicate key",
@ -2683,7 +2682,7 @@
"erc20:eth:FANX:7f67": "(AUTO) duplicate key",
"erc20:eth:FLMC:04cc": "(AUTO) duplicate key",
"erc20:eth:FLMC:5976": "(AUTO) duplicate key",
"erc20:eth:FTC": "(AUTO) duplicate key",
"erc20:eth:FTC": "duplicate key with bitcoin:FTC",
"erc20:eth:FUCK:65be": "(AUTO) duplicate key",
"erc20:eth:FUCK:ab16": "(AUTO) duplicate key",
"erc20:eth:FXC:4a57": "(AUTO) duplicate key",
@ -2737,7 +2736,7 @@
"erc20:eth:PRPS:7641": "(AUTO) duplicate key",
"erc20:eth:PRPS:d94f": "(AUTO) duplicate key",
"erc20:eth:PRPS:e40c": "(AUTO) duplicate key",
"erc20:eth:PTC": "(AUTO) duplicate key",
"erc20:eth:PTC": "duplicate key with bitcoin:PTC",
"erc20:eth:RCT:13f2": "(AUTO) duplicate key",
"erc20:eth:RCT:2a3a": "(AUTO) duplicate key",
"erc20:eth:RING:86e5": "(AUTO) duplicate key",
@ -2747,7 +2746,7 @@
"erc20:eth:SKRP:324a": "(AUTO) duplicate key",
"erc20:eth:SKRP:6e34": "(AUTO) duplicate key",
"erc20:eth:SKRP:fdfe": "(AUTO) duplicate key",
"erc20:eth:SMART": "(AUTO) duplicate key",
"erc20:eth:SMART": "duplicate key with bitcoin:SMART",
"erc20:eth:SMT:2dcf": "(AUTO) duplicate key",
"erc20:eth:SMT:55f9": "(AUTO) duplicate key",
"erc20:eth:SMT:78eb": "(AUTO) duplicate key",
@ -2759,7 +2758,6 @@
"erc20:eth:TIC:7243": "(AUTO) duplicate key",
"erc20:eth:TICO:7f4b": "(AUTO) duplicate key",
"erc20:eth:TICO:a5db": "(AUTO) duplicate key",
"erc20:eth:TRC": "(AUTO) duplicate key",
"erc20:eth:TRX": "switched to custom network",
"erc20:eth:UMKA:105d": "(AUTO) duplicate key",
"erc20:eth:UMKA:8e5a": "(AUTO) duplicate key",

View File

@ -195,6 +195,16 @@ def process_erc20(coins_dict):
clear_support(device, key)
def clear_erc20_mixed_buckets(buckets):
for bucket in buckets.values():
tokens = [coin for coin in bucket if coin_info.is_token(coin)]
if tokens == bucket:
continue
if len(tokens) == 1:
tokens[0]["duplicate"] = False
@click.group()
def cli():
pass
@ -207,7 +217,8 @@ def fix(dry_run):
Prunes orphaned keys and ensures that ERC20 duplicate info matches support info.
"""
all_coins, _ = coin_info.coin_info_with_duplicates()
all_coins, buckets = coin_info.coin_info_with_duplicates()
clear_erc20_mixed_buckets(buckets)
coins_dict = all_coins.as_dict()
orphaned = find_orphaned_support_keys(coins_dict)
@ -240,7 +251,8 @@ def check(check_tokens, ignore_missing):
support info, but will not fail when missing coins are found. This is
useful in Travis.
"""
all_coins, _ = coin_info.coin_info_with_duplicates()
all_coins, buckets = coin_info.coin_info_with_duplicates()
clear_erc20_mixed_buckets(buckets)
coins_dict = all_coins.as_dict()
checks_ok = True