mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-21 09:39:02 +00:00
fixup! wip
This commit is contained in:
parent
cb45cd1677
commit
c231286916
@ -228,10 +228,10 @@ class TrezorClient:
|
||||
|
||||
def _read(self, session_id: int | None = None) -> t.Any:
|
||||
if isinstance(self.protocol, ProtocolV1Channel):
|
||||
self.protocol.read()
|
||||
return self.protocol.read()
|
||||
elif isinstance(self.protocol, ProtocolV2Channel):
|
||||
assert session_id is not None
|
||||
self.protocol.read(session_id=session_id)
|
||||
return self.protocol.read(session_id=session_id)
|
||||
else:
|
||||
raise Exception("Unknown client protocol")
|
||||
|
||||
|
@ -807,7 +807,6 @@ class DebugUI:
|
||||
|
||||
def __init__(self, debuglink: DebugLink) -> None:
|
||||
self.debuglink = debuglink
|
||||
self.pins: t.Iterator[str] | None = None
|
||||
self.clear()
|
||||
|
||||
def clear(self) -> None:
|
||||
@ -1069,20 +1068,16 @@ class TrezorClientDebugLink(TrezorClient):
|
||||
|
||||
self.sync_responses()
|
||||
|
||||
def __getattr__(self, name: str) -> t.Any:
|
||||
return getattr(self._session, name)
|
||||
|
||||
def __setattr__(self, name: str, value: t.Any) -> None:
|
||||
if hasattr(self._session, name):
|
||||
setattr(self._session, name, value)
|
||||
else:
|
||||
self.__dict__[name] = value
|
||||
# So that we can choose right screenshotting logic (T1 vs TT)
|
||||
# and know the supported debug capabilities
|
||||
self.debug.model = self.model
|
||||
self.debug.version = self.version
|
||||
|
||||
self.reset_debug_features()
|
||||
|
||||
@property
|
||||
def protocol_version(self) -> int:
|
||||
return self.client.protocol_version
|
||||
def layout_type(self) -> LayoutType:
|
||||
return self.debug.layout_type
|
||||
|
||||
def get_new_client(self) -> TrezorClientDebugLink:
|
||||
new_client = TrezorClientDebugLink(
|
||||
@ -1284,10 +1279,8 @@ class TrezorClientDebugLink(TrezorClient):
|
||||
actual_responses = self.actual_responses
|
||||
|
||||
# grab a copy of the inputflow generator to raise an exception through it
|
||||
if isinstance(self.client, TrezorClientDebugLink) and isinstance(
|
||||
self.client.ui, DebugUI
|
||||
):
|
||||
input_flow = self.client.ui.input_flow
|
||||
if isinstance(self.ui, DebugUI):
|
||||
input_flow = self.ui.input_flow
|
||||
else:
|
||||
input_flow = None
|
||||
|
||||
@ -1404,10 +1397,6 @@ class TrezorClientDebugLink(TrezorClient):
|
||||
self.actual_responses.append(resp)
|
||||
return resp
|
||||
|
||||
def reset_protocol(self):
|
||||
super().reset_protocol()
|
||||
self._seedless_session = self.get_seedless_session(new_session=True)
|
||||
|
||||
|
||||
def load_device(
|
||||
session: "Session",
|
||||
|
Loading…
Reference in New Issue
Block a user