mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
Updated TREZOR plugin to work with trezorlib>=0.8.0.
This commit is contained in:
parent
0506985487
commit
a30d59912e
2 changed files with 6 additions and 11 deletions
|
@ -76,13 +76,8 @@ class TrezorCompatiblePlugin(HW_PluginBase):
|
||||||
|
|
||||||
def _try_hid(self, device):
|
def _try_hid(self, device):
|
||||||
self.print_error("Trying to connect over USB...")
|
self.print_error("Trying to connect over USB...")
|
||||||
if device.interface_number == 1:
|
|
||||||
pair = [None, device.path]
|
|
||||||
else:
|
|
||||||
pair = [device.path, None]
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.hid_transport(pair)
|
return self.hid_transport(device)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
# see fdb810ba622dc7dbe1259cbafb5b28e19d2ab114
|
# see fdb810ba622dc7dbe1259cbafb5b28e19d2ab114
|
||||||
# raise
|
# raise
|
||||||
|
|
|
@ -6,9 +6,9 @@ class TrezorKeyStore(TrezorCompatibleKeyStore):
|
||||||
device = 'TREZOR'
|
device = 'TREZOR'
|
||||||
|
|
||||||
class TrezorPlugin(TrezorCompatiblePlugin):
|
class TrezorPlugin(TrezorCompatiblePlugin):
|
||||||
firmware_URL = 'https://www.mytrezor.com'
|
firmware_URL = 'https://wallet.trezor.io'
|
||||||
libraries_URL = 'https://github.com/trezor/python-trezor'
|
libraries_URL = 'https://github.com/trezor/python-trezor'
|
||||||
minimum_firmware = (1, 3, 3)
|
minimum_firmware = (1, 5, 2)
|
||||||
keystore_class = TrezorKeyStore
|
keystore_class = TrezorKeyStore
|
||||||
|
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
|
@ -20,15 +20,15 @@ class TrezorPlugin(TrezorCompatiblePlugin):
|
||||||
self.client_class = client.TrezorClient
|
self.client_class = client.TrezorClient
|
||||||
self.ckd_public = trezorlib.ckd_public
|
self.ckd_public = trezorlib.ckd_public
|
||||||
self.types = trezorlib.client.types
|
self.types = trezorlib.client.types
|
||||||
self.DEVICE_IDS = trezorlib.transport_hid.DEVICE_IDS
|
self.DEVICE_IDS = (trezorlib.transport_hid.DEV_TREZOR1, trezorlib.transport_hid.DEV_TREZOR2)
|
||||||
self.libraries_available = True
|
self.libraries_available = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
self.libraries_available = False
|
self.libraries_available = False
|
||||||
TrezorCompatiblePlugin.__init__(self, *args)
|
TrezorCompatiblePlugin.__init__(self, *args)
|
||||||
|
|
||||||
def hid_transport(self, pair):
|
def hid_transport(self, device):
|
||||||
from trezorlib.transport_hid import HidTransport
|
from trezorlib.transport_hid import HidTransport
|
||||||
return HidTransport(pair)
|
return HidTransport.find_by_path(device.path)
|
||||||
|
|
||||||
def bridge_transport(self, d):
|
def bridge_transport(self, d):
|
||||||
from trezorlib.transport_bridge import BridgeTransport
|
from trezorlib.transport_bridge import BridgeTransport
|
||||||
|
|
Loading…
Add table
Reference in a new issue