1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00
Go to file
matejcik 4c8c96272c emu: fix flag options with defaults
Click REALLY INSISTS you provide on/off switches for your options.
You can use is_flag, but then the presence of the option changes based
on the default value.

Which makes sense, really:
@option("-f", "foobar", is_flag=True, default=False)
you would expect `./cli -f` to have `foobar is True`

whereas with
@option("-f", "foobar", is_flag=True, default=True)
you would expect `./cli -f` to have `foobar is False`, otherwise it's a
no-op

this becomes fun with `default=os.environ.get("SOMETHING")`, because
then the effect of the option CHANGES with a value of environment
variable!

there's two ways around this:
a) don't use defaults, update the flag explicitly, like:
   foobar = foobar or os.environ.get("FOOBAR") == "1"
b) forget about is_flag and specify an on/off switch, where the default
   value works as intended

since the latter is also technically speaking more correct, i'm doing it
2020-02-12 13:32:05 +01:00
.github/ISSUE_TEMPLATE github: update issue templates 2019-12-03 04:01:02 +01:00
ci ci: ensure system Python 3.7 is used even if other pythons are available 2020-02-11 11:53:34 +01:00
common Merge pull request #803 from trezor/passphrase 2020-02-11 16:01:59 +01:00
core emu: fix flag options with defaults 2020-02-12 13:32:05 +01:00
crypto crypto: derive public key in hdnode_sign only for supported ed25519 curves 2020-01-18 15:18:03 +00:00
docs Merge pull request #803 from trezor/passphrase 2020-02-11 16:01:59 +01:00
legacy all: shut down emulator on error_shutdown 2020-02-12 13:31:31 +01:00
python python: add detailed logging to emulator runner 2020-02-12 13:31:58 +01:00
storage ci: add junit for a nice tests overview 2020-01-03 12:44:12 +00:00
tests tests: simplify change_wipe_code test with PIN queuing 2020-02-12 13:31:31 +01:00
tools ci: upload ui tests fixtures 2020-01-03 15:07:46 +00:00
vendor vendor: update nanopb to 0.4.1 2020-02-04 18:12:09 +01:00
.clang-format style: fix weirdness in modtrezorio-fatfs.h 2019-09-12 16:49:51 +02:00
.gitignore ci: improve pipenv caching 2019-05-24 09:18:00 +02:00
.gitlab-ci.yml ci: ensure system Python 3.7 is used even if other pythons are available 2020-02-11 11:53:34 +01:00
.gitmodules vendor: change fido2-tests to our fork 2019-11-01 12:35:12 +01:00
.travis.yml ci/travis: update python to 3.7 2019-12-08 09:28:35 +00:00
build-docker.sh build: in build-docker.sh, remove containers after we are done 2019-12-11 14:21:07 +01:00
CONTRIBUTING.md docs: move docs to root 2019-12-06 12:24:20 +00:00
create_monorepo.py all: replace /bin/bash with /usr/bin/env bash 2019-09-12 17:35:55 +02:00
Makefile build: make sure resources are built for 'make mypy' 2020-01-28 16:42:24 +01:00
Pipfile pipfile: add nanopb to Pipfile 2020-02-04 17:15:21 +00:00
Pipfile.lock pipfile: add nanopb to Pipfile 2020-02-04 17:15:21 +00:00
README.md docs: move docs to root 2019-12-06 12:24:20 +00:00
SECURITY.md docs: use monospace for fingerprints 2019-08-16 18:47:46 +02:00
setup.cfg core: add short summary to pytest to see what failed right away 2020-01-28 09:32:03 +00:00
shell.nix shell.nix: do not enforce purity 2020-01-16 14:52:29 +01:00

Trezor Firmware

img

Repository Structure

  • ci: Gitlab CI configuration files
  • common/defs: JSON coin definitions and support tables
  • common/protob: Common protobuf definitions for the Trezor protocol
  • common/tools: Tools for managing coin definitions and related data
  • core: Trezor Core, firmware implementation for Trezor T
  • crypto: Stand-alone cryptography library used by both Trezor Core and the Trezor One firmware
  • docs: Assorted documentation
  • legacy: Trezor One firmware implementation
  • python: Python client library and the trezorctl command
  • storage: NORCOW storage implementation used by both Trezor Core and the Trezor One firmware
  • tests: Firmware unit test suite
  • tools: Miscellaneous build and helper scripts
  • vendor: Submodules for external dependencies

Contribute

See CONTRIBUTING.md.

Also please have a look at the docs, either in the docs folder or at docs.trezor.io before contributing. The misc chapter should be read in particular because it contains some useful assorted knowledge.

Security vulnerability disclosure

Please report suspected security vulnerabilities in private to security@satoshilabs.com, also see the disclosure section on the Trezor.io website. Please do NOT create publicly viewable issues for suspected security vulnerabilities.

Issue Labels

Priority

Label Meaning (SLA)
P1 Urgent The current release + potentially immediate hotfix (30 days)
P2 High The next release (60 days)
P3 Medium Within the next 3 releases (90 days)
P4 Low Anything outside the next 3 releases (120 days)

Severity

Label Impact
S1 Blocker Outage, broken feature with no workaround
S2 Critical Broken feature, workaround too complex & unacceptable
S3 Major Broken feature, workaround acceptable
S4 Low Functionality inconvenience or cosmetic issue

CI

The complete test suite is running on a public GitLab CI. If you are an external contributor, we also have a Travis instance where a small subset of tests is running as well - mostly style and easy fast checks, which are quite common to fail for new contributors.

Documentation

See the docs folder or visit docs.trezor.io.