mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 04:18:10 +00:00
fix(python/trezorctl): improve docs and behavior around unexpected messages
closes #2254
This commit is contained in:
parent
8c3d3c6548
commit
c12e4edd70
@ -53,7 +53,10 @@ def cli() -> None:
|
||||
@cli.command()
|
||||
@with_client
|
||||
def self_test(client: "TrezorClient") -> str:
|
||||
"""Perform a self-test."""
|
||||
"""Perform a factory self-test.
|
||||
|
||||
Only available on PRODTEST firmware.
|
||||
"""
|
||||
return debuglink.self_test(client)
|
||||
|
||||
|
||||
@ -126,17 +129,25 @@ def load(
|
||||
if not label:
|
||||
label = "SLIP-0014"
|
||||
|
||||
return debuglink.load_device(
|
||||
client,
|
||||
mnemonic=list(mnemonic),
|
||||
pin=pin,
|
||||
passphrase_protection=passphrase_protection,
|
||||
label=label,
|
||||
language="en-US",
|
||||
skip_checksum=ignore_checksum,
|
||||
needs_backup=needs_backup,
|
||||
no_backup=no_backup,
|
||||
)
|
||||
try:
|
||||
return debuglink.load_device(
|
||||
client,
|
||||
mnemonic=list(mnemonic),
|
||||
pin=pin,
|
||||
passphrase_protection=passphrase_protection,
|
||||
label=label,
|
||||
language="en-US",
|
||||
skip_checksum=ignore_checksum,
|
||||
needs_backup=needs_backup,
|
||||
no_backup=no_backup,
|
||||
)
|
||||
except exceptions.TrezorFailure as e:
|
||||
if e.code == messages.FailureType.UnexpectedMessage:
|
||||
raise click.ClickException(
|
||||
"Unrecognized message. Make sure your Trezor is using debug firmware."
|
||||
)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
Loading…
Reference in New Issue
Block a user