mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-09 01:28:45 +00:00
fixup! chore(tests): adapt testing framework to session based [no changelog]
This commit is contained in:
parent
f589003fa7
commit
b41c19d42a
@ -227,6 +227,15 @@ class TrezorClient:
|
|||||||
protocol = ProtocolV2Channel(self.transport, self.mapping)
|
protocol = ProtocolV2Channel(self.transport, self.mapping)
|
||||||
return protocol
|
return protocol
|
||||||
|
|
||||||
|
def reset_protocol(self):
|
||||||
|
if self._protocol_version == ProtocolVersion.PROTOCOL_V1:
|
||||||
|
self.protocol = ProtocolV1Channel(self.transport, self.mapping)
|
||||||
|
elif self._protocol_version == ProtocolVersion.PROTOCOL_V2:
|
||||||
|
self.protocol = ProtocolV2Channel(self.transport, self.mapping)
|
||||||
|
else:
|
||||||
|
assert False
|
||||||
|
self._features = None
|
||||||
|
|
||||||
def is_outdated(self) -> bool:
|
def is_outdated(self) -> bool:
|
||||||
if self.features.bootloader_mode:
|
if self.features.bootloader_mode:
|
||||||
return False
|
return False
|
||||||
|
@ -1471,6 +1471,10 @@ class TrezorClientDebugLink(TrezorClient):
|
|||||||
|
|
||||||
raise RuntimeError("Unexpected call")
|
raise RuntimeError("Unexpected call")
|
||||||
|
|
||||||
|
def reset_protocol(self):
|
||||||
|
super().reset_protocol()
|
||||||
|
self._seedless_session = self.get_seedless_session(new_session=True)
|
||||||
|
|
||||||
|
|
||||||
def load_device(
|
def load_device(
|
||||||
session: "Session",
|
session: "Session",
|
||||||
|
@ -340,11 +340,7 @@ def _client_unlocked(
|
|||||||
# Get a new client
|
# Get a new client
|
||||||
_raw_client = _get_raw_client(request)
|
_raw_client = _get_raw_client(request)
|
||||||
|
|
||||||
_raw_client.protocol = None
|
_raw_client.reset_protocol()
|
||||||
_raw_client.__init__(
|
|
||||||
transport=_raw_client.transport,
|
|
||||||
auto_interact=_raw_client.debug.allow_interactions,
|
|
||||||
)
|
|
||||||
|
|
||||||
if not _raw_client.features.bootloader_mode:
|
if not _raw_client.features.bootloader_mode:
|
||||||
_raw_client.refresh_features()
|
_raw_client.refresh_features()
|
||||||
|
Loading…
Reference in New Issue
Block a user