From c15a1b54f5a6bc315866c87bbd72ff06634db467 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Fri, 22 Nov 2024 16:00:46 +0100 Subject: [PATCH] wip fix cardano part 1 --- python/src/trezorlib/transport/session.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/src/trezorlib/transport/session.py b/python/src/trezorlib/transport/session.py index 1aae80eb9e..5ad859eec4 100644 --- a/python/src/trezorlib/transport/session.py +++ b/python/src/trezorlib/transport/session.py @@ -97,6 +97,7 @@ class SessionV1(Session): session = SessionV1(client, session_id) session.button_callback = client.button_callback session.pin_callback = client.pin_callback + session._init_session(derive_cardano=derive_cardano) return session def _write(self, msg: t.Any) -> None: @@ -109,6 +110,12 @@ class SessionV1(Session): assert isinstance(self.client.protocol, ProtocolV1) return self.client.protocol.read() + def _init_session(self, derive_cardano: bool = False): + self._write( + messages.Initialize(session_id=self.id, derive_cardano=derive_cardano) + ) + _ = self._read() + def _callback_button(session: Session, msg: t.Any) -> t.Any: print("Please confirm action on your Trezor device.") # TODO how to handle UI?