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?