mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-21 23:48:45 +00:00
fix(pytest): fix message filters in SessionDebugWrapper
This commit is contained in:
parent
6783cbff51
commit
c5ab2c2c76
@ -995,10 +995,15 @@ class SessionDebugWrapper(Session):
|
|||||||
return self.client
|
return self.client
|
||||||
|
|
||||||
def _write(self, msg: t.Any) -> None:
|
def _write(self, msg: t.Any) -> None:
|
||||||
|
if isinstance(self.client, TrezorClientDebugLink):
|
||||||
|
msg = self.client._filter_message(msg)
|
||||||
self._session._write(msg)
|
self._session._write(msg)
|
||||||
|
|
||||||
def _read(self) -> t.Any:
|
def _read(self) -> t.Any:
|
||||||
return self._session._read()
|
msg = self._session._read()
|
||||||
|
if isinstance(self.client, TrezorClientDebugLink):
|
||||||
|
msg = self.client._filter_message(msg)
|
||||||
|
return msg
|
||||||
|
|
||||||
def resume(self) -> None:
|
def resume(self) -> None:
|
||||||
self._session.resume()
|
self._session.resume()
|
||||||
@ -1037,6 +1042,10 @@ class TrezorClientDebugLink(TrezorClient):
|
|||||||
|
|
||||||
protocol: ProtocolV1Channel | ProtocolV2Channel
|
protocol: ProtocolV1Channel | ProtocolV2Channel
|
||||||
actual_responses: list[protobuf.MessageType] | None = None
|
actual_responses: list[protobuf.MessageType] | None = None
|
||||||
|
filters: t.Dict[
|
||||||
|
t.Type[protobuf.MessageType],
|
||||||
|
t.Callable[[protobuf.MessageType], protobuf.MessageType] | None,
|
||||||
|
] = {}
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user