Fixed TREZOR plugin to work with python-trezor>=0.7.0 (to be released).
This commit is contained in:
parent
5bcadd6651
commit
fdb810ba62
|
@ -106,15 +106,19 @@ class TrezorCompatiblePlugin(HW_PluginBase):
|
||||||
pair = [device.path, None]
|
pair = [device.path, None]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.HidTransport(pair)
|
from trezorlib.transport_hid import HidTransport
|
||||||
|
return HidTransport(pair)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
|
raise
|
||||||
self.print_error("cannot connect at", device.path, str(e))
|
self.print_error("cannot connect at", device.path, str(e))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _try_bridge(self, device):
|
def _try_bridge(self, device):
|
||||||
self.print_error("Trying to connect over Trezor Bridge...")
|
self.print_error("Trying to connect over Trezor Bridge...")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.BridgeTransport({'path': hexlify(device.path)})
|
from trezorlib.transport_bridge import BridgeTransport
|
||||||
|
return BridgeTransport({'path': hexlify(device.path)})
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.print_error("cannot connect to bridge", str(e))
|
self.print_error("cannot connect to bridge", str(e))
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -15,8 +15,7 @@ class TrezorPlugin(TrezorCompatiblePlugin):
|
||||||
from .client import TrezorClient as client_class
|
from .client import TrezorClient as client_class
|
||||||
import trezorlib.ckd_public as ckd_public
|
import trezorlib.ckd_public as ckd_public
|
||||||
from trezorlib.client import types
|
from trezorlib.client import types
|
||||||
from trezorlib.transport_hid import HidTransport, DEVICE_IDS
|
from trezorlib.transport_hid import DEVICE_IDS
|
||||||
from trezorlib.transport_bridge import BridgeTransport
|
|
||||||
libraries_available = True
|
libraries_available = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
libraries_available = False
|
libraries_available = False
|
||||||
|
|
Loading…
Reference in New Issue