1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-03 12:00:59 +00:00

coins_details: drop hidden coins from listing, regenerate

also precalculate percent market cap supported
This commit is contained in:
matejcik 2018-10-29 18:42:18 +01:00
parent 9a8d01a891
commit 7d618036ab
2 changed files with 686 additions and 1423 deletions

File diff suppressed because it is too large Load Diff

View File

@ -115,6 +115,9 @@ def summary(coins, api_key):
t2_coins=t2_coins, t2_coins=t2_coins,
marketcap_usd=supported_marketcap, marketcap_usd=supported_marketcap,
total_marketcap_usd=total_marketcap, total_marketcap_usd=total_marketcap,
marketcap_supported="{:.02f} %".format(
100 * supported_marketcap / total_marketcap
),
) )
@ -267,9 +270,10 @@ def check_missing_data(coins):
coin["hidden"] = 1 coin["hidden"] = 1
# summary of hidden coins # summary of hidden coins
for k, coin in coins.items(): hidden_coins = [k for k, coin in coins.items() if coin.get("hidden")]
if coin.get("hidden"): for key in hidden_coins:
LOG.debug(f"{k}: Coin is hidden") del coins[key]
LOG.debug(f"{k}: Coin is hidden")
def apply_overrides(coins): def apply_overrides(coins):