1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

trezorlib: rename device.*_device to device.*

This commit is contained in:
matejcik 2018-08-10 13:32:50 +02:00
parent a3d560529c
commit 65d8adb0be
2 changed files with 8 additions and 8 deletions

View File

@ -456,10 +456,10 @@ class ProtocolMixin(object):
# Device functionality # Device functionality
self_test = MovedTo(device.self_test) self_test = MovedTo(device.self_test)
wipe_device = MovedTo(device.wipe_device) wipe_device = MovedTo(device.wipe)
recovery_device = MovedTo(device.recovery_device) recovery_device = MovedTo(device.recover)
reset_device = MovedTo(device.reset_device) reset_device = MovedTo(device.reset)
backup_device = MovedTo(device.backup_device) backup_device = MovedTo(device.backup)
load_device_by_mnemonic = MovedTo(device.load_device_by_mnemonic) load_device_by_mnemonic = MovedTo(device.load_device_by_mnemonic)
load_device_by_xprv = MovedTo(device.load_device_by_xprv) load_device_by_xprv = MovedTo(device.load_device_by_xprv)

View File

@ -86,14 +86,14 @@ def set_u2f_counter(client, u2f_counter):
@expect(proto.Success, field="message") @expect(proto.Success, field="message")
def wipe_device(client): def wipe(client):
ret = client.call(proto.WipeDevice()) ret = client.call(proto.WipeDevice())
client.init_device() client.init_device()
return ret return ret
@expect(proto.Success, field="message") @expect(proto.Success, field="message")
def recovery_device(client, word_count, passphrase_protection, pin_protection, label, language, type=proto.RecoveryDeviceType.ScrambledWords, expand=False, dry_run=False): def recover(client, word_count, passphrase_protection, pin_protection, label, language, type=proto.RecoveryDeviceType.ScrambledWords, expand=False, dry_run=False):
if client.features.initialized and not dry_run: if client.features.initialized and not dry_run:
raise RuntimeError("Device is initialized already. Call wipe_device() and try again.") raise RuntimeError("Device is initialized already. Call wipe_device() and try again.")
@ -123,7 +123,7 @@ def recovery_device(client, word_count, passphrase_protection, pin_protection, l
@expect(proto.Success, field="message") @expect(proto.Success, field="message")
@session @session
def reset_device(client, display_random, strength, passphrase_protection, pin_protection, label, language, u2f_counter=0, skip_backup=False): def reset(client, display_random, strength, passphrase_protection, pin_protection, label, language, u2f_counter=0, skip_backup=False):
if client.features.initialized: if client.features.initialized:
raise RuntimeError("Device is initialized already. Call wipe_device() and try again.") raise RuntimeError("Device is initialized already. Call wipe_device() and try again.")
@ -149,7 +149,7 @@ def reset_device(client, display_random, strength, passphrase_protection, pin_pr
@expect(proto.Success, field="message") @expect(proto.Success, field="message")
def backup_device(client): def backup(client):
ret = client.call(proto.BackupDevice()) ret = client.call(proto.BackupDevice())
return ret return ret