1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

Fix style error

This commit is contained in:
M1nd3r 2024-03-28 15:17:56 +01:00
parent 1e2254e79d
commit 8486ce51f3
3 changed files with 7 additions and 7 deletions

View File

@ -197,11 +197,11 @@ class ChannelContext(Context):
message = message_handler.wrap_protobuf_load(buf, expected_type)
print(message)
# ------------------------------------------------TYPE ERROR------------------------------------------------
session_message: ThpCreateNewSession = message
print("passphrase:", session_message.passphrase)
assert isinstance(message, ThpCreateNewSession)
print("passphrase:", message.passphrase)
# await thp_messages.handle_CreateNewSession(message)
if session_message.passphrase is not None:
self.create_new_session(session_message.passphrase)
if message.passphrase is not None:
self.create_new_session(message.passphrase)
else:
self.create_new_session()
except Exception as e:

View File

@ -2,7 +2,7 @@ import ustruct # pyright:ignore[reportMissingModuleSource]
from storage.cache_thp import BROADCAST_CHANNEL_ID
from trezor import protobuf
from trezor.messages import CreateNewSession
from trezor.messages import ThpCreateNewSession
from .. import message_handler
from ..protocol_common import Message
@ -90,7 +90,7 @@ def decode_message(buffer: bytes, msg_type: int) -> protobuf.MessageType:
return x
async def handle_CreateNewSession(msg: CreateNewSession) -> None:
async def handle_CreateNewSession(msg: ThpCreateNewSession) -> None:
print(msg.passphrase)
print(msg.on_device)
pass

View File

@ -183,7 +183,7 @@ class Field:
class _MessageTypeMeta(type):
def __init__(cls, name: str, bases: tuple, d: dict) -> None:
super().__init__(name, bases, d)
super().__init__(name, bases, d) # type: ignore [Expected 1 positional argument]
if name != "MessageType":
cls.__init__ = MessageType.__init__ # type: ignore ["__init__" is obscured by a declaration of the same name;;Cannot assign member "__init__" for type "_MessageTypeMeta"]