1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-16 02:10:55 +00:00

defs: coins/tools - add support field to generated coins.json

This commit is contained in:
Pavol Rusnak 2018-06-05 12:50:57 +02:00
parent 5520e98f4a
commit aa9f46c9ab
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -167,18 +167,20 @@ def process_json(fn):
scriptdir = os.path.dirname(os.path.realpath(__file__))
support_json = json.load(open(scriptdir + '/../../support.json'))
if len(sys.argv) > 1 and not sys.argv[1].startswith('-'):
support_json = json.load(open(scriptdir + '/../../support.json'))
support_list = support_json[sys.argv[1]].keys()
else:
support_list = None
coins = {}
defs = {}
for fn in glob.glob(scriptdir + '/../*.json'):
c, d = process_json(fn)
n = c['coin_name']
c['support'] = {}
for s in support_json.keys():
c['support'][s] = support_json[s][n] if n in support_json[s] else None
if support_list is None or n in support_list:
coins[n] = c
defs[n] = d