From 2f198f0b467b148ac35edd2d7ff610784b5202e6 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 29 Nov 2018 16:39:31 +0100 Subject: [PATCH] coins_details: hide testnet and deprecated tokens --- tools/coins_details.py | 12 +++++++++++- tools/diffize_coins_details.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/coins_details.py b/tools/coins_details.py index b5bbf90e05..e98974ef71 100755 --- a/tools/coins_details.py +++ b/tools/coins_details.py @@ -223,10 +223,18 @@ def update_bitcoin(coins, support_info): def update_erc20(coins, networks, support_info): # TODO skip disabled networks? network_support = {n["chain"]: support_info.get(n["key"]) for n in networks} + network_testnets = {n["chain"] for n in networks if "Testnet" in n["name"]} res = update_simple(coins, support_info, "erc20") for coin in coins: key = coin["key"] chain = coin["chain"] + + hidden = False + if chain in network_testnets: + hidden = True + if "deprecation" in coin: + hidden = True + if network_support.get(chain, {}).get("webwallet"): wallets = WALLETS_ETH_NATIVE else: @@ -239,6 +247,8 @@ def update_erc20(coins, networks, support_info): links={}, wallet=wallets, ) + if hidden: + details["hidden"] = True if coin.get("website"): details["links"]["Homepage"] = coin["website"] if coin.get("social", {}).get("github"): @@ -325,7 +335,7 @@ def check_missing_data(coins): hidden_coins = [k for k, coin in coins.items() if coin.get("hidden")] for key in hidden_coins: del coins[key] - LOG.debug(f"{k}: Coin is hidden") + LOG.debug(f"{key}: Coin is hidden") def apply_overrides(coins): diff --git a/tools/diffize_coins_details.py b/tools/diffize_coins_details.py index 430b8f2726..1e1a697960 100755 --- a/tools/diffize_coins_details.py +++ b/tools/diffize_coins_details.py @@ -24,7 +24,7 @@ def diffize_file(coins_details, tmp): for link in links: links[link] = links[link].rstrip("/") for wallet in wallets: - wallets[wallet] = wallets[wallet].rstrip("/") + wallet["url"] = wallet["url"].rstrip("/") if not coin.get("wallet"): coin.pop("wallet", None)