hw wallets: test client is not None during setup_device

This commit is contained in:
SomberNight 2018-05-06 14:45:03 +02:00
parent 811eea0b6b
commit e523b65767
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
4 changed files with 12 additions and 0 deletions

View file

@ -695,6 +695,9 @@ class DigitalBitboxPlugin(HW_PluginBase):
devmgr = self.device_manager()
device_id = device_info.device.id_
client = devmgr.client_by_id(device_id)
if client is None:
raise Exception(_('Failed to create a client for this device.') + '\n' +
_('Make sure it is in the correct state.'))
client.handler = self.create_handler(wizard)
if purpose == HWD_SETUP_NEW_WALLET:
client.setupRunning = True

View file

@ -224,6 +224,9 @@ class KeepKeyPlugin(HW_PluginBase):
devmgr = self.device_manager()
device_id = device_info.device.id_
client = devmgr.client_by_id(device_id)
if client is None:
raise Exception(_('Failed to create a client for this device.') + '\n' +
_('Make sure it is in the correct state.'))
# fixme: we should use: client.handler = wizard
client.handler = self.create_handler(wizard)
if not device_info.initialized:

View file

@ -585,6 +585,9 @@ class LedgerPlugin(HW_PluginBase):
devmgr = self.device_manager()
device_id = device_info.device.id_
client = devmgr.client_by_id(device_id)
if client is None:
raise Exception(_('Failed to create a client for this device.') + '\n' +
_('Make sure it is in the correct state.'))
client.handler = self.create_handler(wizard)
client.get_xpub("m/44'/0'", 'standard') # TODO replace by direct derivation once Nano S > 1.1

View file

@ -257,6 +257,9 @@ class TrezorPlugin(HW_PluginBase):
devmgr = self.device_manager()
device_id = device_info.device.id_
client = devmgr.client_by_id(device_id)
if client is None:
raise Exception(_('Failed to create a client for this device.') + '\n' +
_('Make sure it is in the correct state.'))
# fixme: we should use: client.handler = wizard
client.handler = self.create_handler(wizard)
if not device_info.initialized: