1
0

hw wallets: introduce HardwareHandlerBase

previously, client.handler was sometimes
- an InstallWizard
- a QtHandlerBase where win was an ElectrumWindow
- a QtHandlerBase where win was an InstallWizard
- a CmdLineHandler

That's just too much dynamic untyped undocumented polymorphism...
Now it will never be an InstallWizard (replaced with QtHandlerBase where win is an InstallWizard),
and now in all cases client.handler is an instance of HardwareHandlerBase, yay.

related: #6063
This commit is contained in:
SomberNight
2020-03-31 14:40:25 +02:00
parent 3b7299bfde
commit 6760c3f252
15 changed files with 87 additions and 40 deletions

View File

@@ -282,7 +282,6 @@ class KeepKeyPlugin(HW_PluginBase):
if client is None:
raise UserFacingException(_('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:
self.initialize_device(device_id, wizard, client.handler)
@@ -294,7 +293,7 @@ class KeepKeyPlugin(HW_PluginBase):
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 = wizard
client.handler = self.create_handler(wizard)
xpub = client.get_xpub(derivation, xtype)
client.used()
return xpub