mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 08:51:32 +00:00
bitbox02: adapt to updated master
This commit is contained in:
parent
a4fe14bb82
commit
c0c3627bd2
2 changed files with 6 additions and 17 deletions
|
@ -569,39 +569,28 @@ class BitBox02Plugin(HW_PluginBase):
|
||||||
def setup_device(
|
def setup_device(
|
||||||
self, device_info: DeviceInfo, wizard: BaseWizard, purpose: int
|
self, device_info: DeviceInfo, wizard: BaseWizard, purpose: int
|
||||||
):
|
):
|
||||||
devmgr = self.device_manager()
|
|
||||||
device_id = device_info.device.id_
|
device_id = device_info.device.id_
|
||||||
client = devmgr.client_by_id(device_id)
|
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard)
|
||||||
if client is None:
|
|
||||||
raise UserFacingException(
|
|
||||||
_("Failed to create a client for this device.")
|
|
||||||
+ "\n"
|
|
||||||
+ _("Make sure it is in the correct state.")
|
|
||||||
)
|
|
||||||
client.handler = self.create_handler(wizard)
|
|
||||||
if client.bitbox02_device is None:
|
if client.bitbox02_device is None:
|
||||||
client.pairing_dialog()
|
client.pairing_dialog()
|
||||||
|
return client
|
||||||
|
|
||||||
def get_xpub(
|
def get_xpub(
|
||||||
self, device_id: bytes, derivation: str, xtype: str, wizard: BaseWizard
|
self, device_id: str, derivation: str, xtype: str, wizard: BaseWizard
|
||||||
):
|
):
|
||||||
if xtype not in self.SUPPORTED_XTYPES:
|
if xtype not in self.SUPPORTED_XTYPES:
|
||||||
raise ScriptTypeNotSupported(
|
raise ScriptTypeNotSupported(
|
||||||
_("This type of script is not supported with {}.").format(self.device)
|
_("This type of script is not supported with {}.").format(self.device)
|
||||||
)
|
)
|
||||||
devmgr = self.device_manager()
|
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard)
|
||||||
client = devmgr.client_by_id(device_id)
|
|
||||||
if client.bitbox02_device is None:
|
if client.bitbox02_device is None:
|
||||||
client.handler = self.create_handler(wizard)
|
|
||||||
client.pairing_dialog()
|
client.pairing_dialog()
|
||||||
return client.get_xpub(derivation, xtype)
|
return client.get_xpub(derivation, xtype)
|
||||||
|
|
||||||
def get_client(self, keystore: BitBox02_KeyStore, force_pair: bool = True):
|
def get_client(self, keystore: BitBox02_KeyStore, force_pair: bool = True):
|
||||||
devmgr = self.device_manager()
|
devmgr = self.device_manager()
|
||||||
handler = keystore.handler
|
handler = keystore.handler
|
||||||
with devmgr.hid_lock:
|
client = devmgr.client_for_keystore(self, handler, keystore, force_pair)
|
||||||
client = devmgr.client_for_keystore(self, handler, keystore, force_pair)
|
|
||||||
|
|
||||||
return client
|
return client
|
||||||
|
|
||||||
def show_address(
|
def show_address(
|
||||||
|
|
|
@ -165,7 +165,7 @@ class HW_PluginBase(BasePlugin):
|
||||||
handler: Optional['HardwareHandlerBase']) -> Optional['HardwareClientBase']:
|
handler: Optional['HardwareHandlerBase']) -> Optional['HardwareClientBase']:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def get_xpub(self, device_id, derivation: str, xtype, wizard: 'BaseWizard') -> str:
|
def get_xpub(self, device_id: str, derivation: str, xtype, wizard: 'BaseWizard') -> str:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def create_handler(self, window) -> 'HardwareHandlerBase':
|
def create_handler(self, window) -> 'HardwareHandlerBase':
|
||||||
|
|
Loading…
Add table
Reference in a new issue