From 88fa3c7381252820b025370ba1b07dc8350e13c0 Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 20 Nov 2018 17:51:04 +0100 Subject: [PATCH] cointool: fix uniformity check also uniformize misc.json --- defs/misc/misc.json | 30 ++++++++++++++++++++---------- tools/cointool.py | 7 ++++--- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/defs/misc/misc.json b/defs/misc/misc.json index 5a3d707440..b3437748b7 100644 --- a/defs/misc/misc.json +++ b/defs/misc/misc.json @@ -7,7 +7,8 @@ "links": { "Homepage": "https://lisk.io/", "Github": "https://github.com/LiskHQ/lisk" - } + }, + "wallet": {} }, { "name": "Stellar", @@ -30,7 +31,8 @@ "links": { "Homepage": "https://getmonero.org", "Github": "https://github.com/monero-project/monero" - } + }, + "wallet": {} }, { "name": "Ripple", @@ -40,7 +42,8 @@ "links": { "Homepage": "https://ripple.com", "Github": "https://github.com/ripple/rippled" - } + }, + "wallet": {} }, { "name": "Cardano", @@ -76,7 +79,8 @@ "links": { "Homepage": "https://ont.io", "Github": "https://github.com/ontio/ontology" - } + }, + "wallet": {} }, { "name": "Wanchain", @@ -86,7 +90,8 @@ "links": { "Homepage": "https://wanchain.org", "Github": "https://github.com/wanchain/go-wanchain" - } + }, + "wallet": {} }, { "name": "EOS", @@ -96,7 +101,8 @@ "links": { "Homepage": "https://eos.io", "Github": "https://github.com/EOSIO/eos" - } + }, + "wallet": {} }, { "name": "Tron", @@ -106,7 +112,8 @@ "links": { "Homepage": "https://tron.network", "Github": "https://github.com/tronprotocol/java-tron" - } + }, + "wallet": {} }, { "name": "Omni", @@ -116,7 +123,8 @@ "links": { "Homepage": "https://www.omnilayer.org", "Github": "https://github.com/OmniLayer" - } + }, + "wallet": {} }, { "name": "MaidSafeCoin", @@ -126,7 +134,8 @@ "links": { "Homepage": "https://maidsafe.net", "Github": "https://github.com/maidsafe" - } + }, + "wallet": {} }, { "name": "Tether", @@ -135,6 +144,7 @@ "curve": "secp256k1", "links": { "Homepage": "https://tether.to" - } + }, + "wallet": {} } ] diff --git a/tools/cointool.py b/tools/cointool.py index e107dd0274..b99d2a2628 100755 --- a/tools/cointool.py +++ b/tools/cointool.py @@ -365,7 +365,7 @@ def check_icons(coins): return check_passed -IGNORE_NONUNIFORM_KEYS = frozenset(("unsupported", "duplicate", "notes")) +IGNORE_NONUNIFORM_KEYS = frozenset(("unsupported", "duplicate")) def check_key_uniformity(coins): @@ -381,11 +381,12 @@ def check_key_uniformity(coins): buckets.sort(key=lambda x: len(x)) majority = buckets[-1] rest = sum(buckets[:-1], []) - reference_keyset = set(majority[0].keys()) + reference_keyset = set(majority[0].keys()) | IGNORE_NONUNIFORM_KEYS + print(reference_keyset) for coin in rest: key = coin["key"] - keyset = set(coin.keys()) + keyset = set(coin.keys()) | IGNORE_NONUNIFORM_KEYS missing = ", ".join(reference_keyset - keyset) if missing: print_log(logging.ERROR, "coin {} has missing keys: {}".format(key, missing))