mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 03:50:58 +00:00
update protobuf, update tox.ini, prepare for BackupDevice
This commit is contained in:
parent
c51089803d
commit
71996c1e43
13
tox.ini
13
tox.ini
@ -1,6 +1,13 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py27,py34,py35,py36
|
envlist =
|
||||||
|
py27,
|
||||||
|
py34,
|
||||||
|
py35,
|
||||||
|
py36,
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps = -rrequirements.txt
|
deps =
|
||||||
commands = python -m compileall trezorlib/
|
-rrequirements.txt
|
||||||
|
commands =
|
||||||
|
python -m compileall trezorlib/
|
||||||
|
python trezorctl
|
||||||
|
11
trezorctl
11
trezorctl
@ -297,7 +297,11 @@ class Commands(object):
|
|||||||
|
|
||||||
def reset_device(self, args):
|
def reset_device(self, args):
|
||||||
return self.client.reset_device(True, args.strength, args.passphrase_protection,
|
return self.client.reset_device(True, args.strength, args.passphrase_protection,
|
||||||
args.pin_protection, args.label, 'english')
|
args.pin_protection, args.label, 'english',
|
||||||
|
args.u2f_counter, args.skip_backup)
|
||||||
|
|
||||||
|
def backup_device(self, args):
|
||||||
|
return self.client.backup_device()
|
||||||
|
|
||||||
def sign_message(self, args):
|
def sign_message(self, args):
|
||||||
address_n = self.client.expand_path(args.n)
|
address_n = self.client.expand_path(args.n)
|
||||||
@ -398,6 +402,7 @@ class Commands(object):
|
|||||||
recovery_device.help = 'Start safe recovery workflow'
|
recovery_device.help = 'Start safe recovery workflow'
|
||||||
load_device.help = 'Load custom configuration to the device'
|
load_device.help = 'Load custom configuration to the device'
|
||||||
reset_device.help = 'Perform device setup and generate new seed'
|
reset_device.help = 'Perform device setup and generate new seed'
|
||||||
|
backup_device.help = 'Perform device seed backup'
|
||||||
sign_message.help = 'Sign message using address of given path'
|
sign_message.help = 'Sign message using address of given path'
|
||||||
verify_message.help = 'Verify message'
|
verify_message.help = 'Verify message'
|
||||||
encrypt_message.help = 'Encrypt message'
|
encrypt_message.help = 'Encrypt message'
|
||||||
@ -492,8 +497,12 @@ class Commands(object):
|
|||||||
(('-p', '--pin-protection'), {'action': 'store_true', 'default': False}),
|
(('-p', '--pin-protection'), {'action': 'store_true', 'default': False}),
|
||||||
(('-r', '--passphrase-protection'), {'action': 'store_true', 'default': False}),
|
(('-r', '--passphrase-protection'), {'action': 'store_true', 'default': False}),
|
||||||
(('-l', '--label'), {'type': str, 'default': ''}),
|
(('-l', '--label'), {'type': str, 'default': ''}),
|
||||||
|
(('-u', '--u2f-counter'), {'type': int, 'default': 0}),
|
||||||
|
(('-s', '--skip-backup'), {'action': 'store_true', 'default': False}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
backup_device.arguments = ()
|
||||||
|
|
||||||
sign_message.arguments = (
|
sign_message.arguments = (
|
||||||
(('-c', '--coin'), {'type': str, 'default': 'Bitcoin'}),
|
(('-c', '--coin'), {'type': str, 'default': 'Bitcoin'}),
|
||||||
(('-n', '-address'), {'type': str}),
|
(('-n', '-address'), {'type': str}),
|
||||||
|
@ -859,17 +859,19 @@ class ProtocolMixin(object):
|
|||||||
@field('message')
|
@field('message')
|
||||||
@expect(proto.Success)
|
@expect(proto.Success)
|
||||||
@session
|
@session
|
||||||
def reset_device(self, display_random, strength, passphrase_protection, pin_protection, label, language):
|
def reset_device(self, display_random, strength, passphrase_protection, pin_protection, label, language, u2f_counter, skip_backup):
|
||||||
if self.features.initialized:
|
if self.features.initialized:
|
||||||
raise Exception("Device is initialized already. Call wipe_device() and try again.")
|
raise Exception("Device is initialized already. Call wipe_device() and try again.")
|
||||||
|
|
||||||
# Begin with device reset workflow
|
# Begin with device reset workflow
|
||||||
msg = proto.ResetDevice(display_random=display_random,
|
msg = proto.ResetDevice(display_random=display_random,
|
||||||
strength=strength,
|
strength=strength,
|
||||||
language=language,
|
|
||||||
passphrase_protection=bool(passphrase_protection),
|
passphrase_protection=bool(passphrase_protection),
|
||||||
pin_protection=bool(pin_protection),
|
pin_protection=bool(pin_protection),
|
||||||
label=label)
|
language=language,
|
||||||
|
label=label,
|
||||||
|
u2f_counter=u2f_counter,
|
||||||
|
skip_backup=bool(skip_backup))
|
||||||
|
|
||||||
resp = self.call(msg)
|
resp = self.call(msg)
|
||||||
if not isinstance(resp, proto.EntropyRequest):
|
if not isinstance(resp, proto.EntropyRequest):
|
||||||
@ -881,6 +883,12 @@ class ProtocolMixin(object):
|
|||||||
self.init_device()
|
self.init_device()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@field('message')
|
||||||
|
@expect(proto.Success)
|
||||||
|
def backup_device(self):
|
||||||
|
ret = self.call(proto.BackupDevice())
|
||||||
|
return ret
|
||||||
|
|
||||||
@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, skip_checksum=False, expand=False):
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user