cointool: fix uniformity check

also uniformize misc.json
pull/41/head
matejcik 6 years ago
parent 56fbd816c9
commit 88fa3c7381

@ -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": {}
}
]

@ -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))

Loading…
Cancel
Save