mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 07:23:25 +00:00
plugins/bitbox02: fix min version check
Inform the user that they need to upgrade if their firmware version is out of date. The previous `check_device_firmware_version()` was dead code, and the bb02 function called inside also does not exist.
This commit is contained in:
parent
b863150fe3
commit
b9b08b768f
1 changed files with 8 additions and 8 deletions
|
@ -33,6 +33,7 @@ try:
|
||||||
HARDENED,
|
HARDENED,
|
||||||
u2fhid,
|
u2fhid,
|
||||||
bitbox_api_protocol,
|
bitbox_api_protocol,
|
||||||
|
FirmwareVersionOutdatedException,
|
||||||
)
|
)
|
||||||
requirements_ok = True
|
requirements_ok = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -161,11 +162,17 @@ class BitBox02Client(HardwareClientBase):
|
||||||
hid_device = hid.device()
|
hid_device = hid.device()
|
||||||
hid_device.open_path(self.bitbox_hid_info["path"])
|
hid_device.open_path(self.bitbox_hid_info["path"])
|
||||||
|
|
||||||
self.bitbox02_device = bitbox02.BitBox02(
|
|
||||||
|
bitbox02_device = bitbox02.BitBox02(
|
||||||
transport=u2fhid.U2FHid(hid_device),
|
transport=u2fhid.U2FHid(hid_device),
|
||||||
device_info=self.bitbox_hid_info,
|
device_info=self.bitbox_hid_info,
|
||||||
noise_config=NoiseConfig(),
|
noise_config=NoiseConfig(),
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
|
bitbox02_device.check_min_version()
|
||||||
|
except FirmwareVersionOutdatedException:
|
||||||
|
raise
|
||||||
|
self.bitbox02_device = bitbox02_device
|
||||||
|
|
||||||
self.fail_if_not_initialized()
|
self.fail_if_not_initialized()
|
||||||
|
|
||||||
|
@ -176,13 +183,6 @@ class BitBox02Client(HardwareClientBase):
|
||||||
"Please initialize the BitBox02 using the BitBox app first before using the BitBox02 in electrum"
|
"Please initialize the BitBox02 using the BitBox app first before using the BitBox02 in electrum"
|
||||||
)
|
)
|
||||||
|
|
||||||
def check_device_firmware_version(self) -> bool:
|
|
||||||
if self.bitbox02_device is None:
|
|
||||||
raise Exception(
|
|
||||||
"Need to setup communication first before attempting any BitBox02 calls"
|
|
||||||
)
|
|
||||||
return self.bitbox02_device.check_firmware_version()
|
|
||||||
|
|
||||||
def coin_network_from_electrum_network(self) -> int:
|
def coin_network_from_electrum_network(self) -> int:
|
||||||
if constants.net.TESTNET:
|
if constants.net.TESTNET:
|
||||||
return bitbox02.btc.TBTC
|
return bitbox02.btc.TBTC
|
||||||
|
|
Loading…
Add table
Reference in a new issue