mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-04 05:42:34 +00:00
trezorctl: load_device -s now loads SLIP-0014 mnemonic, --skip-checksum renamed to --ignore-checksum
This commit is contained in:
parent
23ab43d612
commit
d865c0ea31
16
trezorctl
16
trezorctl
@ -224,10 +224,11 @@ def wipe_device(client):
|
|||||||
@click.option('-p', '--pin', default='')
|
@click.option('-p', '--pin', default='')
|
||||||
@click.option('-r', '--passphrase-protection', is_flag=True)
|
@click.option('-r', '--passphrase-protection', is_flag=True)
|
||||||
@click.option('-l', '--label', default='')
|
@click.option('-l', '--label', default='')
|
||||||
@click.option('-s', '--skip-checksum', is_flag=True)
|
@click.option('-i', '--ignore-checksum', is_flag=True)
|
||||||
|
@click.option('-s', '--slip0014', is_flag=True)
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def load_device(client, mnemonic, expand, xprv, pin, passphrase_protection, label, skip_checksum):
|
def load_device(client, mnemonic, expand, xprv, pin, passphrase_protection, label, ignore_checksum, slip0014):
|
||||||
if not mnemonic and not xprv:
|
if not mnemonic and not xprv and not slip0014:
|
||||||
raise CallException(types.Failure_DataError, 'Please provide mnemonic or xprv')
|
raise CallException(types.Failure_DataError, 'Please provide mnemonic or xprv')
|
||||||
|
|
||||||
if mnemonic:
|
if mnemonic:
|
||||||
@ -237,7 +238,7 @@ def load_device(client, mnemonic, expand, xprv, pin, passphrase_protection, labe
|
|||||||
passphrase_protection,
|
passphrase_protection,
|
||||||
label,
|
label,
|
||||||
'english',
|
'english',
|
||||||
skip_checksum,
|
ignore_checksum,
|
||||||
expand
|
expand
|
||||||
)
|
)
|
||||||
if xprv:
|
if xprv:
|
||||||
@ -248,6 +249,13 @@ def load_device(client, mnemonic, expand, xprv, pin, passphrase_protection, labe
|
|||||||
label,
|
label,
|
||||||
'english'
|
'english'
|
||||||
)
|
)
|
||||||
|
if slip0014:
|
||||||
|
return client.load_device_by_mnemonic(
|
||||||
|
' '.join(['all'] * 12),
|
||||||
|
pin,
|
||||||
|
passphrase_protection,
|
||||||
|
'SLIP-0014'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@cli.command(help='Start safe recovery workflow.')
|
@cli.command(help='Start safe recovery workflow.')
|
||||||
|
@ -928,7 +928,7 @@ class ProtocolMixin(object):
|
|||||||
|
|
||||||
@field('message')
|
@field('message')
|
||||||
@expect(proto.Success)
|
@expect(proto.Success)
|
||||||
def load_device_by_mnemonic(self, mnemonic, pin, passphrase_protection, label, language, skip_checksum=False, expand=False):
|
def load_device_by_mnemonic(self, mnemonic, pin, passphrase_protection, label, language='english', skip_checksum=False, expand=False):
|
||||||
# Convert mnemonic to UTF8 NKFD
|
# Convert mnemonic to UTF8 NKFD
|
||||||
mnemonic = Mnemonic.normalize_string(mnemonic)
|
mnemonic = Mnemonic.normalize_string(mnemonic)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user