mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-19 08:39:03 +00:00
fixup! feat(python): implement session based trezorlib
This commit is contained in:
parent
48070bcef4
commit
fb03cc2afe
@ -47,8 +47,8 @@ Or visit https://suite.trezor.io/
|
||||
|
||||
|
||||
class ProtocolVersion(IntEnum):
|
||||
PROTOCOL_V1 = 0x01 # Codec
|
||||
PROTOCOL_V2 = 0x02 # THP
|
||||
V1 = 0x01 # Codec
|
||||
V2 = 0x02 # THP
|
||||
|
||||
|
||||
class TrezorClient:
|
||||
@ -88,7 +88,7 @@ class TrezorClient:
|
||||
self.protocol.mapping = self.mapping
|
||||
|
||||
if isinstance(self.protocol, ProtocolV1Channel):
|
||||
self._protocol_version = ProtocolVersion.PROTOCOL_V1
|
||||
self._protocol_version = ProtocolVersion.V1
|
||||
else:
|
||||
raise Exception("Unknown protocol version")
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ class TrezorClientDebugLink(TrezorClient):
|
||||
|
||||
# Start by canceling whatever is on screen. This will work to cancel T1 PIN
|
||||
# prompt, which is in TINY mode and does not respond to `Ping`.
|
||||
if self.protocol_version is ProtocolVersion.PROTOCOL_V1:
|
||||
if self.protocol_version is ProtocolVersion.V1:
|
||||
assert isinstance(self.protocol, ProtocolV1Channel)
|
||||
self.protocol.write(messages.Cancel())
|
||||
resp = self.protocol.read()
|
||||
|
Loading…
Reference in New Issue
Block a user