|
|
@ -268,12 +268,8 @@ class TrezorPlugin(HW_PluginBase): |
|
|
|
return HDNodePathType(node=node, address_n=address_n) |
|
|
|
|
|
|
|
def setup_device(self, device_info, wizard, purpose): |
|
|
|
devmgr = self.device_manager() |
|
|
|
device_id = device_info.device.id_ |
|
|
|
client = devmgr.client_by_id(device_id) |
|
|
|
if client is None: |
|
|
|
raise UserFacingException(_('Failed to create a client for this device.') + '\n' + |
|
|
|
_('Make sure it is in the correct state.')) |
|
|
|
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard) |
|
|
|
|
|
|
|
if not client.is_uptodate(): |
|
|
|
msg = (_('Outdated {} firmware for device labelled {}. Please ' |
|
|
@ -281,7 +277,6 @@ class TrezorPlugin(HW_PluginBase): |
|
|
|
.format(self.device, client.label(), self.firmware_URL)) |
|
|
|
raise OutdatedHwFirmwareException(msg) |
|
|
|
|
|
|
|
client.handler = self.create_handler(wizard) |
|
|
|
if not device_info.initialized: |
|
|
|
self.initialize_device(device_id, wizard, client.handler) |
|
|
|
is_creating_wallet = purpose == HWD_SETUP_NEW_WALLET |
|
|
@ -291,9 +286,7 @@ class TrezorPlugin(HW_PluginBase): |
|
|
|
def get_xpub(self, device_id, derivation, xtype, wizard): |
|
|
|
if xtype not in self.SUPPORTED_XTYPES: |
|
|
|
raise ScriptTypeNotSupported(_('This type of script is not supported with {}.').format(self.device)) |
|
|
|
devmgr = self.device_manager() |
|
|
|
client = devmgr.client_by_id(device_id) |
|
|
|
client.handler = self.create_handler(wizard) |
|
|
|
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard) |
|
|
|
xpub = client.get_xpub(derivation, xtype) |
|
|
|
client.used() |
|
|
|
return xpub |
|
|
|