mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 02:05:19 +00:00
don't use internal cmdtr module in trezor plugin
This commit is contained in:
parent
801bcd69e8
commit
bb78873e24
1 changed files with 6 additions and 2 deletions
|
@ -14,11 +14,11 @@ from lib.wallet import NewWallet
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import cmdtr
|
|
||||||
from trezorlib.client import types
|
from trezorlib.client import types
|
||||||
from trezorlib.client import proto, BaseClient, ProtocolMixin
|
from trezorlib.client import proto, BaseClient, ProtocolMixin
|
||||||
from trezorlib.qt.pinmatrix import PinMatrixWidget
|
from trezorlib.qt.pinmatrix import PinMatrixWidget
|
||||||
from trezorlib.transport import ConnectionError
|
from trezorlib.transport import ConnectionError
|
||||||
|
from trezorlib.transport_hid import HidTransport
|
||||||
TREZOR = True
|
TREZOR = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
TREZOR = False
|
TREZOR = False
|
||||||
|
@ -117,7 +117,11 @@ class TrezorWallet(NewWallet):
|
||||||
raise Exception('please install github.com/trezor/python-trezor')
|
raise Exception('please install github.com/trezor/python-trezor')
|
||||||
|
|
||||||
if not self.client or self.client.bad:
|
if not self.client or self.client.bad:
|
||||||
self.transport = cmdtr.get_transport('usb', '')
|
try:
|
||||||
|
d = HidTransport.enumerate()[0]
|
||||||
|
self.transport = HidTransport(d)
|
||||||
|
except:
|
||||||
|
raise Exception("Trezor not found")
|
||||||
self.client = QtGuiTrezorClient(self.transport)
|
self.client = QtGuiTrezorClient(self.transport)
|
||||||
self.client.set_tx_api(self)
|
self.client.set_tx_api(self)
|
||||||
#self.client.clear_session()# TODO Doesn't work with firmware 1.1, returns proto.Failure
|
#self.client.clear_session()# TODO Doesn't work with firmware 1.1, returns proto.Failure
|
||||||
|
|
Loading…
Add table
Reference in a new issue