mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
tools: rename coin_gen.py to cointool.py
This commit is contained in:
parent
962178fbeb
commit
a090388c5f
@ -5,7 +5,7 @@
|
||||
Central module that extracts information from jsons in `defs/` directory.
|
||||
Its most important function is `get_all()`.
|
||||
|
||||
### `coin_gen.py`
|
||||
### `cointool.py`
|
||||
|
||||
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`
|
||||
* availability of bitcore/blockbook backends
|
||||
* 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
|
||||
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
|
||||
following subcommands:
|
||||
|
||||
* __`rewrite`__: regenerates `support.json` in a canonical format, i.e., only
|
||||
mandatory fields in fixed order.
|
||||
|
||||
* __`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.
|
||||
* __`check`__: checks validity of support data. Ensures that data is valid,
|
||||
there are no orphaned keys in `support.json`, no known coins have missing
|
||||
support info, etc.
|
||||
|
||||
* __`show <keyword>`__: searches coin database, matching key (`coin:BTC`),
|
||||
name ("Bitcoin") or shortcut / ticker symbol ("BTC"). Displays all coins that match
|
||||
|
@ -233,19 +233,11 @@ def cli():
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--missing-support/--no-missing-support",
|
||||
"-s",
|
||||
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",
|
||||
)
|
||||
# fmt: off
|
||||
@click.option("--missing-support/--no-missing-support", "-s", 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")
|
||||
# fmt: on
|
||||
def check(missing_support, backend, icons):
|
||||
"""Validate coin definitions.
|
||||
|
||||
@ -328,9 +320,11 @@ def coindefs(outfile):
|
||||
|
||||
|
||||
@cli.command()
|
||||
# fmt: off
|
||||
@click.argument("paths", metavar="[path]...", nargs=-1)
|
||||
@click.option("-o", "--outfile", type=click.File("w"), help="Alternate output file")
|
||||
@click.option("-v", "--verbose", is_flag=True, help="Print rendered file names")
|
||||
# fmt: on
|
||||
def render(paths, outfile, verbose):
|
||||
"""Generate source code from Mako templates.
|
||||
|
Loading…
Reference in New Issue
Block a user