1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

tools: rename coin_gen.py to cointool.py

This commit is contained in:
matejcik 2018-08-15 18:46:00 +02:00
parent 962178fbeb
commit a090388c5f
2 changed files with 10 additions and 20 deletions

View File

@ -5,7 +5,7 @@
Central module that extracts information from jsons in `defs/` directory. Central module that extracts information from jsons in `defs/` directory.
Its most important function is `get_all()`. Its most important function is `get_all()`.
### `coin_gen.py` ### `cointool.py`
Code and data generator. Has the following functions: Code and data generator. Has the following functions:
@ -13,7 +13,6 @@ Code and data generator. Has the following functions:
* schema validity in `defs/coins/*.json` * schema validity in `defs/coins/*.json`
* availability of bitcore/blockbook backends * availability of bitcore/blockbook backends
* icon format * icon format
* support data, i.e., that `support.json` matches the rest of data
* __`coins_json`__: generates `coins.json` for use in python-trezor, connect * __`coins_json`__: generates `coins.json` for use in python-trezor, connect
and wallet. By default outputs to current directory. and wallet. By default outputs to current directory.
@ -39,12 +38,9 @@ If needed, any value can be overriden in `coins_details.override.json`.
Support info management. Ensures `support.json` is in the proper format. Has the Support info management. Ensures `support.json` is in the proper format. Has the
following subcommands: following subcommands:
* __`rewrite`__: regenerates `support.json` in a canonical format, i.e., only * __`check`__: checks validity of support data. Ensures that data is valid,
mandatory fields in fixed order. there are no orphaned keys in `support.json`, no known coins have missing
support info, etc.
* __`check`__: checks validity of support data. This is the same check
that runs as part of `coin_gen.py check`, except missing support data is always
an error.
* __`show <keyword>`__: searches coin database, matching key (`coin:BTC`), * __`show <keyword>`__: searches coin database, matching key (`coin:BTC`),
name ("Bitcoin") or shortcut / ticker symbol ("BTC"). Displays all coins that match name ("Bitcoin") or shortcut / ticker symbol ("BTC"). Displays all coins that match

View File

@ -233,19 +233,11 @@ def cli():
@cli.command() @cli.command()
@click.option( # fmt: off
"--missing-support/--no-missing-support", @click.option("--missing-support/--no-missing-support", "-s", default=False, help="Fail if support info for a coin is missing")
"-s", @click.option("--backend/--no-backend", "-b", default=False, help="Check blockbook/bitcore responses")
default=False,
help="Fail if support info for a coin is missing",
)
@click.option(
"--backend/--no-backend",
"-b",
default=False,
help="Check blockbook/bitcore responses",
)
@click.option("--icons/--no-icons", default=True, help="Check icon files") @click.option("--icons/--no-icons", default=True, help="Check icon files")
# fmt: on
def check(missing_support, backend, icons): def check(missing_support, backend, icons):
"""Validate coin definitions. """Validate coin definitions.
@ -328,9 +320,11 @@ def coindefs(outfile):
@cli.command() @cli.command()
# fmt: off
@click.argument("paths", metavar="[path]...", nargs=-1) @click.argument("paths", metavar="[path]...", nargs=-1)
@click.option("-o", "--outfile", type=click.File("w"), help="Alternate output file") @click.option("-o", "--outfile", type=click.File("w"), help="Alternate output file")
@click.option("-v", "--verbose", is_flag=True, help="Print rendered file names") @click.option("-v", "--verbose", is_flag=True, help="Print rendered file names")
# fmt: on
def render(paths, outfile, verbose): def render(paths, outfile, verbose):
"""Generate source code from Mako templates. """Generate source code from Mako templates.