diff --git a/core/src/trezor/wire/thp/channel.py b/core/src/trezor/wire/thp/channel.py index a01e4295dd..0f60dfa774 100644 --- a/core/src/trezor/wire/thp/channel.py +++ b/core/src/trezor/wire/thp/channel.py @@ -132,7 +132,7 @@ class Channel: # TODO Check CRC and if valid, check tag, if valid update nonces self._finish_fallback() # TODO self.write() failure device is busy - use channel buffer to send this failure message!! - return + return None return received_message_handler.handle_received_message(self, buffer) elif self.expected_payload_length + INIT_HEADER_LENGTH > self.bytes_read: self.is_cont_packet_expected = True diff --git a/core/tests/test_apps.bitcoin.approver.py b/core/tests/test_apps.bitcoin.approver.py index d691648b64..408f96d7ee 100644 --- a/core/tests/test_apps.bitcoin.approver.py +++ b/core/tests/test_apps.bitcoin.approver.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip import storage.cache_codec diff --git a/core/tests/test_apps.bitcoin.authorization.py b/core/tests/test_apps.bitcoin.authorization.py index 4faf202989..aedcadba92 100644 --- a/core/tests/test_apps.bitcoin.authorization.py +++ b/core/tests/test_apps.bitcoin.authorization.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip import storage.cache_codec diff --git a/core/tests/test_storage.cache.py b/core/tests/test_storage.cache.py index 0837d76b92..1e43e09d98 100644 --- a/core/tests/test_storage.cache.py +++ b/core/tests/test_storage.cache.py @@ -378,7 +378,7 @@ class TestStorageCache(unittest.TestCase): session_id = cache_codec.start_session() self.assertEqual(cache_codec.start_session(session_id), session_id) get_active_session().set(KEY, b"A") - for i in range(_PROTOCOL_CACHE._MAX_SESSIONS_COUNT): + for _ in range(_PROTOCOL_CACHE._MAX_SESSIONS_COUNT): cache_codec.start_session() self.assertNotEqual(cache_codec.start_session(session_id), session_id) self.assertIsNone(get_active_session().get(KEY)) diff --git a/core/tests/test_trezor.wire.thp.checksum.py b/core/tests/test_trezor.wire.thp.checksum.py index 41c9325001..f5d59d6805 100644 --- a/core/tests/test_trezor.wire.thp.checksum.py +++ b/core/tests/test_trezor.wire.thp.checksum.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip if utils.USE_THP: diff --git a/core/tests/test_trezor.wire.thp.crypto.py b/core/tests/test_trezor.wire.thp.crypto.py index d26785ce65..1eee57f8cb 100644 --- a/core/tests/test_trezor.wire.thp.crypto.py +++ b/core/tests/test_trezor.wire.thp.crypto.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip from trezorcrypto import aesgcm, curve25519 @@ -101,8 +102,8 @@ class TestTrezorHostProtocolCrypto(unittest.TestCase): def test_iv_from_nonce(self): for v in self.vectors_iv: - x = v[0] - y = x.to_bytes(8, "big") + # x = v[0] + # y = x.to_bytes(8, "big") iv = crypto._get_iv_from_nonce(v[0]) self.assertEqual(iv, v[1]) with self.assertRaises(AssertionError) as e: diff --git a/core/tests/test_trezor.wire.thp.py b/core/tests/test_trezor.wire.thp.py index 1599a59307..f4e0bce287 100644 --- a/core/tests/test_trezor.wire.thp.py +++ b/core/tests/test_trezor.wire.thp.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip from mock_wire_interface import MockHID from trezor import config, io, protobuf @@ -256,7 +257,7 @@ class TestTrezorHostProtocol(unittest.TestCase): # test invalid tag in handshake phase cid_2 = get_channel_id_from_response(expected_response_1) - cid_2_bytes = cid_2.to_bytes(2, "big") + # cid_2_bytes = cid_2.to_bytes(2, "big") channel = thp_main._CHANNELS[cid_2] channel.iface = self.interface diff --git a/core/tests/test_trezor.wire.thp.writer.py b/core/tests/test_trezor.wire.thp.writer.py index ecaec3c61a..0f6110761a 100644 --- a/core/tests/test_trezor.wire.thp.writer.py +++ b/core/tests/test_trezor.wire.thp.writer.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip from typing import Any, Awaitable diff --git a/core/tests/test_trezor.wire.thp_deprecated.py b/core/tests/test_trezor.wire.thp_deprecated.py index 550b29e64d..49f2256e69 100644 --- a/core/tests/test_trezor.wire.thp_deprecated.py +++ b/core/tests/test_trezor.wire.thp_deprecated.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from common import * # isort:skip import ustruct from typing import TYPE_CHECKING diff --git a/core/tests/thp_common.py b/core/tests/thp_common.py index d22243d29e..86a023d3c6 100644 --- a/core/tests/thp_common.py +++ b/core/tests/thp_common.py @@ -1,3 +1,4 @@ +# flake8: noqa: F403,F405 from trezor import utils from trezor.wire.thp import ChannelState