mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 11:28:14 +00:00
chore(python): add shortcut in trezorlib for academic seed
This commit is contained in:
parent
2396e10fbb
commit
31e0518588
1
python/.changelog.d/4282.added
Normal file
1
python/.changelog.d/4282.added
Normal file
@ -0,0 +1 @@
|
||||
Added shortcut for loading a debug device with the "academic" SLIP39 seed.
|
@ -100,6 +100,7 @@ def wipe(client: "TrezorClient", bootloader: bool) -> str:
|
||||
@click.option("-l", "--label", default="")
|
||||
@click.option("-i", "--ignore-checksum", is_flag=True)
|
||||
@click.option("-s", "--slip0014", is_flag=True)
|
||||
@click.option("-a", "--academic", is_flag=True)
|
||||
@click.option("-b", "--needs-backup", is_flag=True)
|
||||
@click.option("-n", "--no-backup", is_flag=True)
|
||||
@with_client
|
||||
@ -111,6 +112,7 @@ def load(
|
||||
label: str,
|
||||
ignore_checksum: bool,
|
||||
slip0014: bool,
|
||||
academic: bool,
|
||||
needs_backup: bool,
|
||||
no_backup: bool,
|
||||
) -> str:
|
||||
@ -118,13 +120,19 @@ def load(
|
||||
|
||||
This functionality is only available in debug mode.
|
||||
"""
|
||||
if slip0014 and mnemonic:
|
||||
raise click.ClickException("Cannot use -s and -m together.")
|
||||
if sum((slip0014, academic, bool(mnemonic))) > 1:
|
||||
raise click.ClickException("Cannot use the options -a, -m, and -s together.")
|
||||
|
||||
if slip0014:
|
||||
mnemonic = [" ".join(["all"] * 12)]
|
||||
if not label:
|
||||
label = "SLIP-0014"
|
||||
elif academic:
|
||||
mnemonic = [
|
||||
"academic again academic academic academic academic academic academic academic academic academic academic academic academic academic academic academic pecan provide remember"
|
||||
]
|
||||
if not label:
|
||||
label = "ACADEMIC"
|
||||
|
||||
try:
|
||||
return debuglink.load_device(
|
||||
|
Loading…
Reference in New Issue
Block a user