From a68baa62420d307c17389b2dced9623b25b4ceb3 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Wed, 4 Sep 2024 13:10:33 +0200 Subject: [PATCH] chore(trezorlib): remove unnecessary prints [no changelog] --- python/src/trezorlib/client.py | 7 ------- python/src/trezorlib/transport/thp/thp_io.py | 6 ------ 2 files changed, 13 deletions(-) diff --git a/python/src/trezorlib/client.py b/python/src/trezorlib/client.py index 2eb5419ac..f5bb40cd3 100644 --- a/python/src/trezorlib/client.py +++ b/python/src/trezorlib/client.py @@ -146,7 +146,6 @@ class TrezorClient(Generic[UI]): self.session_counter += 1 def resume_session(self) -> None: - print("resume session") new_id = self.transport.resume_session(self.session_id or b"") if self.session_id != new_id: print("Failed to resume session, allocated a new session") @@ -163,12 +162,9 @@ class TrezorClient(Generic[UI]): def call_raw(self, msg: "MessageType") -> "MessageType": __tracebackhide__ = True # for pytest # pylint: disable=W0612 - print("self.call_raw-start") self._raw_write(msg) - print("self.call_raw-after write") x = self._raw_read() - print("self.call_raw-end") return x def _raw_write(self, msg: "MessageType") -> None: @@ -186,7 +182,6 @@ class TrezorClient(Generic[UI]): def _raw_read(self) -> "MessageType": __tracebackhide__ = True # for pytest # pylint: disable=W0612 - print("raw read - start") msg_type, msg_bytes = self.transport.read() print("type/data", msg_type, msg_bytes) LOG.log( @@ -272,7 +267,6 @@ class TrezorClient(Generic[UI]): @session def call(self, msg: "MessageType") -> "MessageType": - print("self.call-start") self.check_firmware_version() resp = self.call_raw(msg) while True: @@ -334,7 +328,6 @@ class TrezorClient(Generic[UI]): self._refresh_features(resp) return resp - # @session def init_device( self, *, diff --git a/python/src/trezorlib/transport/thp/thp_io.py b/python/src/trezorlib/transport/thp/thp_io.py index b62ebb87b..8107c634e 100644 --- a/python/src/trezorlib/transport/thp/thp_io.py +++ b/python/src/trezorlib/transport/thp/thp_io.py @@ -22,22 +22,16 @@ def write_payload_to_wire_and_add_checksum( chksum: bytes = checksum.compute(header.to_bytes_init() + transport_payload) data = transport_payload + chksum write_payload_to_wire(handle, header, data) - print("WOO") def write_payload_to_wire( handle: Handle, header: PacketHeader, transport_payload: bytes ): - print("tttt") handle.open() buffer = bytearray(transport_payload) chunk = header.to_bytes_init() + buffer[: PACKET_LENGTH - INIT_HEADER_LENGTH] - print("x") chunk = chunk.ljust(PACKET_LENGTH, b"\x00") - print("y") - print(hexlify(chunk)) handle.write_chunk(chunk) - print("fgh") buffer = buffer[PACKET_LENGTH - INIT_HEADER_LENGTH :] while buffer: