From b3539ffd11b4172b7d14a086f34bf00cfbc8a0b2 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Tue, 12 Mar 2024 13:37:22 +0100 Subject: [PATCH] Fix import formatting --- core/src/storage/cache.py | 2 +- core/src/storage/cache_codec.py | 3 ++- core/src/storage/cache_thp.py | 1 - core/src/trezor/wire/context.py | 2 +- core/src/trezor/wire/protocol.py | 3 ++- core/src/trezor/wire/thp_session.py | 5 +++-- core/src/trezor/wire/thp_v1.py | 10 ++++------ 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/src/storage/cache.py b/core/src/storage/cache.py index bae005d8b..30fae7ae6 100644 --- a/core/src/storage/cache.py +++ b/core/src/storage/cache.py @@ -3,8 +3,8 @@ import gc from micropython import const from typing import TYPE_CHECKING -from trezor import utils from storage.cache_common import InvalidSessionError, SessionlessCache +from trezor import utils SESSIONLESS_FLAG = const(128) diff --git a/core/src/storage/cache_codec.py b/core/src/storage/cache_codec.py index 161128077..2be0fd321 100644 --- a/core/src/storage/cache_codec.py +++ b/core/src/storage/cache_codec.py @@ -1,8 +1,9 @@ import builtins from micropython import const from typing import TYPE_CHECKING -from trezor import utils + from storage.cache_common import DataCache +from trezor import utils if TYPE_CHECKING: from typing import TypeVar diff --git a/core/src/storage/cache_thp.py b/core/src/storage/cache_thp.py index 970ab17e3..2700fcee8 100644 --- a/core/src/storage/cache_thp.py +++ b/core/src/storage/cache_thp.py @@ -5,7 +5,6 @@ from typing import TYPE_CHECKING from storage.cache_common import DataCache, InvalidSessionError from trezor import utils - if TYPE_CHECKING: from typing import TypeVar diff --git a/core/src/trezor/wire/context.py b/core/src/trezor/wire/context.py index 89701bb5e..bcaa07b43 100644 --- a/core/src/trezor/wire/context.py +++ b/core/src/trezor/wire/context.py @@ -15,9 +15,9 @@ for ButtonRequests. Of course, `context.wait()` transparently works in such situ from typing import TYPE_CHECKING +import trezor.wire.protocol as protocol from trezor import log, loop, protobuf -import trezor.wire.protocol as protocol from .protocol_common import Message if TYPE_CHECKING: diff --git a/core/src/trezor/wire/protocol.py b/core/src/trezor/wire/protocol.py index fc0e565cb..06732d3b5 100644 --- a/core/src/trezor/wire/protocol.py +++ b/core/src/trezor/wire/protocol.py @@ -1,7 +1,8 @@ +from typing import TYPE_CHECKING + from trezor import utils from trezor.wire import codec_v1, thp_v1 from trezor.wire.protocol_common import Message -from typing import TYPE_CHECKING if TYPE_CHECKING: from trezorio import WireInterface diff --git a/core/src/trezor/wire/thp_session.py b/core/src/trezor/wire/thp_session.py index 1db0b4a3c..c192c2531 100644 --- a/core/src/trezor/wire/thp_session.py +++ b/core/src/trezor/wire/thp_session.py @@ -1,12 +1,13 @@ import ustruct +from typing import TYPE_CHECKING + from storage import cache_thp as storage_thp_cache from storage.cache_thp import SessionThpCache from trezor.wire.protocol_common import WireError -from typing import TYPE_CHECKING if TYPE_CHECKING: - from trezorio import WireInterface from enum import IntEnum + from trezorio import WireInterface else: IntEnum = object diff --git a/core/src/trezor/wire/thp_v1.py b/core/src/trezor/wire/thp_v1.py index 1263e49bc..facc1e8e9 100644 --- a/core/src/trezor/wire/thp_v1.py +++ b/core/src/trezor/wire/thp_v1.py @@ -1,15 +1,13 @@ import ustruct from micropython import const from typing import TYPE_CHECKING -from storage.cache_thp import SessionThpCache, BROADCAST_CHANNEL_ID + +import trezor.wire.thp_session as THP +from storage.cache_thp import BROADCAST_CHANNEL_ID, SessionThpCache from trezor import io, loop, utils from trezor.crypto import crc from trezor.wire.protocol_common import Message -import trezor.wire.thp_session as THP -from trezor.wire.thp_session import ( - ThpError, - SessionState -) +from trezor.wire.thp_session import SessionState, ThpError if TYPE_CHECKING: from trezorio import WireInterface