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:
parent
5520e98f4a
commit
aa9f46c9ab
@ -167,18 +167,20 @@ def process_json(fn):
|
||||
scriptdir = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
if len(sys.argv) > 1 and not sys.argv[1].startswith('-'):
|
||||
support_json = json.load(open(scriptdir + '/../../support.json'))
|
||||
if len(sys.argv) > 1 and not sys.argv[1].startswith('-'):
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user