mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-05 13:01:12 +00:00
coins_details: hide testnet and deprecated tokens
This commit is contained in:
parent
5f59b5100b
commit
2f198f0b46
@ -223,10 +223,18 @@ def update_bitcoin(coins, support_info):
|
|||||||
def update_erc20(coins, networks, support_info):
|
def update_erc20(coins, networks, support_info):
|
||||||
# TODO skip disabled networks?
|
# TODO skip disabled networks?
|
||||||
network_support = {n["chain"]: support_info.get(n["key"]) for n in 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")
|
res = update_simple(coins, support_info, "erc20")
|
||||||
for coin in coins:
|
for coin in coins:
|
||||||
key = coin["key"]
|
key = coin["key"]
|
||||||
chain = coin["chain"]
|
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"):
|
if network_support.get(chain, {}).get("webwallet"):
|
||||||
wallets = WALLETS_ETH_NATIVE
|
wallets = WALLETS_ETH_NATIVE
|
||||||
else:
|
else:
|
||||||
@ -239,6 +247,8 @@ def update_erc20(coins, networks, support_info):
|
|||||||
links={},
|
links={},
|
||||||
wallet=wallets,
|
wallet=wallets,
|
||||||
)
|
)
|
||||||
|
if hidden:
|
||||||
|
details["hidden"] = True
|
||||||
if coin.get("website"):
|
if coin.get("website"):
|
||||||
details["links"]["Homepage"] = coin["website"]
|
details["links"]["Homepage"] = coin["website"]
|
||||||
if coin.get("social", {}).get("github"):
|
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")]
|
hidden_coins = [k for k, coin in coins.items() if coin.get("hidden")]
|
||||||
for key in hidden_coins:
|
for key in hidden_coins:
|
||||||
del coins[key]
|
del coins[key]
|
||||||
LOG.debug(f"{k}: Coin is hidden")
|
LOG.debug(f"{key}: Coin is hidden")
|
||||||
|
|
||||||
|
|
||||||
def apply_overrides(coins):
|
def apply_overrides(coins):
|
||||||
|
@ -24,7 +24,7 @@ def diffize_file(coins_details, tmp):
|
|||||||
for link in links:
|
for link in links:
|
||||||
links[link] = links[link].rstrip("/")
|
links[link] = links[link].rstrip("/")
|
||||||
for wallet in wallets:
|
for wallet in wallets:
|
||||||
wallets[wallet] = wallets[wallet].rstrip("/")
|
wallet["url"] = wallet["url"].rstrip("/")
|
||||||
|
|
||||||
if not coin.get("wallet"):
|
if not coin.get("wallet"):
|
||||||
coin.pop("wallet", None)
|
coin.pop("wallet", None)
|
||||||
|
Loading…
Reference in New Issue
Block a user