python: rename unsafe_prompts to safety_checks

pull/1173/head
matejcik 4 years ago
parent a94c0d074d
commit 35c3af87dd

@ -11,7 +11,7 @@ _At the moment, the project does **not** adhere to [Semantic Versioning](https:/
### Added
- `trezorctl set unsafe-prompts` controls the new "unsafe prompts" feature. [#1126]
- `trezorctl set safety-checks` controls the new "safety checks" feature. [#1126]
- `trezorctl btc get-address` can create multisig addresses.
- the following commands are now equivalent in trezorctl: `firmware-update`, `firmware-upgrade`,
`update-firmware`, `upgrade-firmware`

@ -383,7 +383,7 @@ Device settings.
label Set new device label.
passphrase Enable, disable or configure passphrase protection.
pin Set, change or remove PIN.
unsafe-prompts Allow or disallow unsafe prompts.
safety-checks Set safety check level.
wipe-code Set or remove the wipe code.
Stellar commands.

@ -20,6 +20,10 @@ from .. import device, messages
from . import ChoiceType, with_client
ROTATION = {"north": 0, "east": 90, "south": 180, "west": 270}
SAFETY_LEVELS = {
"strict": messages.SafetyCheckLevel.Strict,
"prompt": messages.SafetyCheckLevel.Prompt,
}
@click.group(name="set")
@ -136,21 +140,18 @@ def homescreen(client, filename):
@cli.command()
@click.argument("allow", type=click.Choice(("on", "off")))
@click.argument("level", type=ChoiceType(SAFETY_LEVELS))
@with_client
def unsafe_prompts(client, allow):
"""Allow or disallow unsafe prompts.
def safety_checks(client, level):
"""Set safety check level.
This is a power-user feature. With unsafe prompts enabled, Trezor will ask the user
to confirm possibly dangerous actions instead of rejecting them outright.
Use with caution.
"""
# TODO change this to ChoiceType
if allow == "on":
level = messages.SafetyCheckLevel.Prompt
else:
level = messages.SafetyCheckLevel.Strict
Set to "strict" to get the full Trezor security.
Set to "prompt" if you want to be able to allow potentially unsafe actions, such as
mismatching coin keys or extreme fees.
This is a power-user feature. Use with caution.
"""
return device.apply_settings(client, safety_checks=level)

Loading…
Cancel
Save