diff --git a/common/protob/pb2py b/common/protob/pb2py index bfda315a70..05f699374a 100755 --- a/common/protob/pb2py +++ b/common/protob/pb2py @@ -63,7 +63,8 @@ class ProtoField: if field.type == field.TYPE_MESSAGE: proto_type = py_type = type_name elif field.type == field.TYPE_ENUM: - valuestr = ", ".join(str(v) for v in descriptor.enum_types[type_name]) + value_dict = descriptor.enum_types[type_name] + valuestr = ", ".join(str(v) for v in value_dict.values()) proto_type = 'p.EnumType("{}", ({}))'.format(type_name, valuestr) py_type = "EnumType" + type_name else: @@ -162,7 +163,7 @@ class Descriptor: # find messages and enums self.messages = [] self.enums = [] - self.enum_types = defaultdict(set) + self.enum_types = defaultdict(dict) for file in self.files: self.messages += file.message_type self.enums += file.enum_type @@ -218,17 +219,17 @@ class Descriptor: # please keep the yields aligned # fmt: off ... # https://github.com/ambv/black/issues/385 - yield " def __init__(" - yield " self," + yield " def __init__(" + yield " self," for field in fields: - yield " {}: {} = None,".format(field.name, field.py_type) - yield " ) -> None:" + yield f" {field.name}: {field.py_type} = None," + yield " ) -> None:" for field in fields: if field.repeated: - yield " self.{0} = {0} if {0} is not None else []".format(field.name) + yield f" self.{field.name} = {field.name} if {field.name} is not None else []" else: - yield " self.{0} = {0}".format(field.name) + yield f" self.{field.name} = {field.name}" # fmt: on def create_fields_method(self, fields): @@ -278,19 +279,17 @@ class Descriptor: yield "" yield "if __debug__:" yield " try:" - yield " from typing import Dict, List, Optional" + yield " from typing import Dict, List # noqa: F401" yield " from typing_extensions import Literal # noqa: F401" all_enums = [field for field in fields if field.type_name in self.enum_types] for field in all_enums: - allowed_values = self.enum_types[field.type_name] + allowed_values = self.enum_types[field.type_name].values() valuestr = ", ".join(str(v) for v in sorted(allowed_values)) yield " {} = Literal[{}]".format(field.py_inner_type, valuestr) yield " except ImportError:" - yield " Dict, List, Optional = None, None, None # type: ignore" - for field in all_enums: - yield " {} = None # type: ignore".format(field.py_inner_type) + yield " pass" yield "" yield "" @@ -311,6 +310,11 @@ class Descriptor: def process_enum(self, enum): logging.debug("Processing enum {}".format(enum.name)) + # file header + yield "if False:" + yield " from typing_extensions import Literal" + yield "" + for value in enum.value: # Remove type name from the beginning of the constant # For example "PinMatrixRequestType_Current" -> "Current" @@ -324,8 +328,8 @@ class Descriptor: enum_prefix, _ = enum_prefix.rsplit("Type", 1) name = strip_leader(name, enum_prefix) - self.enum_types[enum.name].add(value.number) - yield "{} = {}".format(name, value.number) + self.enum_types[enum.name][value.name] = value.number + yield f"{name} = {value.number} # type: Literal[{value.number}]" def process_messages(self, messages): for message in sorted(messages, key=lambda m: m.name): diff --git a/core/embed/extmod/modtrezorio/modtrezorio-fatfs.h b/core/embed/extmod/modtrezorio/modtrezorio-fatfs.h index 570c77c6ca..ea7689eb59 100644 --- a/core/embed/extmod/modtrezorio/modtrezorio-fatfs.h +++ b/core/embed/extmod/modtrezorio/modtrezorio-fatfs.h @@ -274,7 +274,7 @@ STATIC const mp_obj_type_t mod_trezorio_FatFSFile_type = { .locals_dict = (void *)&mod_trezorio_FatFSFile_locals_dict, }; -/// class FatFSDir(Iterable[Tuple[int, str, str]]): +/// class FatFSDir(Iterator[Tuple[int, str, str]]): /// """ /// Class encapsulating directory /// """ diff --git a/core/mocks/generated/trezorio.pyi b/core/mocks/generated/trezorio.pyi index eb6d2d69ee..efe2fbdff4 100644 --- a/core/mocks/generated/trezorio.pyi +++ b/core/mocks/generated/trezorio.pyi @@ -54,7 +54,7 @@ class FatFSFile: # extmod/modtrezorio/modtrezorio-fatfs.h -class FatFSDir(Iterable[Tuple[int, str, str]]): +class FatFSDir(Iterator[Tuple[int, str, str]]): """ Class encapsulating directory """ diff --git a/core/src/apps/common/cache.py b/core/src/apps/common/cache.py index e22fd48a7f..6693aebd66 100644 --- a/core/src/apps/common/cache.py +++ b/core/src/apps/common/cache.py @@ -1,6 +1,6 @@ from trezor.crypto import hashlib, hmac, random -from apps.common import storage +from apps.common.storage.device import get_device_id if False: from typing import Optional @@ -28,7 +28,7 @@ def get_state(prev_state: bytes = None, passphrase: str = None) -> Optional[byte def _compute_state(salt: bytes, passphrase: str) -> bytes: # state = HMAC(passphrase, salt || device_id) - message = salt + storage.device.get_device_id().encode() + message = salt + get_device_id().encode() state = hmac.new(passphrase.encode(), message, hashlib.sha256).digest() return salt + state diff --git a/core/src/apps/common/confirm.py b/core/src/apps/common/confirm.py index 06389ffd2a..b2ccca7b76 100644 --- a/core/src/apps/common/confirm.py +++ b/core/src/apps/common/confirm.py @@ -6,18 +6,20 @@ from trezor.ui.confirm import CONFIRMED, INFO, Confirm, HoldToConfirm, InfoConfi if __debug__: from apps.debug import confirm_signal + from trezor.ui.scroll import Paginated if False: from typing import Any, Callable, Optional from trezor import ui from trezor.ui.confirm import ButtonContent, ButtonStyleType from trezor.ui.loader import LoaderStyleType + from trezor.messages.ButtonRequest import EnumTypeButtonRequestType async def confirm( ctx: wire.Context, content: ui.Component, - code: int = ButtonRequestType.Other, + code: EnumTypeButtonRequestType = ButtonRequestType.Other, confirm: Optional[ButtonContent] = Confirm.DEFAULT_CONFIRM, confirm_style: ButtonStyleType = Confirm.DEFAULT_CONFIRM_STYLE, cancel: Optional[ButtonContent] = Confirm.DEFAULT_CANCEL, @@ -27,6 +29,10 @@ async def confirm( await ctx.call(ButtonRequest(code=code), ButtonAck) if content.__class__.__name__ == "Paginated": + # The following works because asserts are omitted in non-debug builds. + # IOW if the assert runs, that means __debug__ is True and Paginated is imported + assert isinstance(content, Paginated) + content.pages[-1] = Confirm( content.pages[-1], confirm, @@ -35,7 +41,7 @@ async def confirm( cancel_style, major_confirm, ) - dialog = content + dialog = content # type: ui.Layout else: dialog = Confirm( content, confirm, confirm_style, cancel, cancel_style, major_confirm @@ -51,7 +57,7 @@ async def info_confirm( ctx: wire.Context, content: ui.Component, info_func: Callable, - code: int = ButtonRequestType.Other, + code: EnumTypeButtonRequestType = ButtonRequestType.Other, confirm: ButtonContent = InfoConfirm.DEFAULT_CONFIRM, confirm_style: ButtonStyleType = InfoConfirm.DEFAULT_CONFIRM_STYLE, cancel: ButtonContent = InfoConfirm.DEFAULT_CANCEL, @@ -80,19 +86,23 @@ async def info_confirm( async def hold_to_confirm( ctx: wire.Context, - content: ui.Component, - code: int = ButtonRequestType.Other, - confirm: ButtonContent = HoldToConfirm.DEFAULT_CONFIRM, + content: ui.Layout, + code: EnumTypeButtonRequestType = ButtonRequestType.Other, + confirm: str = HoldToConfirm.DEFAULT_CONFIRM, confirm_style: ButtonStyleType = HoldToConfirm.DEFAULT_CONFIRM_STYLE, loader_style: LoaderStyleType = HoldToConfirm.DEFAULT_LOADER_STYLE, ) -> bool: await ctx.call(ButtonRequest(code=code), ButtonAck) if content.__class__.__name__ == "Paginated": + # The following works because asserts are omitted in non-debug builds. + # IOW if the assert runs, that means __debug__ is True and Paginated is imported + assert isinstance(content, Paginated) + content.pages[-1] = HoldToConfirm( content.pages[-1], confirm, confirm_style, loader_style ) - dialog = content + dialog = content # type: ui.Layout else: dialog = HoldToConfirm(content, confirm, confirm_style, loader_style) diff --git a/core/src/apps/common/layout.py b/core/src/apps/common/layout.py index b72a5d12b7..a10eab827c 100644 --- a/core/src/apps/common/layout.py +++ b/core/src/apps/common/layout.py @@ -13,7 +13,7 @@ from apps.common import HARDENED from apps.common.confirm import confirm, require_confirm if False: - from typing import Iterable + from typing import Iterable, Iterator from trezor import wire @@ -60,7 +60,7 @@ async def show_pubkey(ctx: wire.Context, pubkey: bytes) -> None: await require_confirm(ctx, text, ButtonRequestType.PublicKey) -def split_address(address: str) -> Iterable[str]: +def split_address(address: str) -> Iterator[str]: return chunks(address, 17) diff --git a/core/src/apps/common/mnemonic.py b/core/src/apps/common/mnemonic.py index e03f1a403c..d556e68ce5 100644 --- a/core/src/apps/common/mnemonic.py +++ b/core/src/apps/common/mnemonic.py @@ -2,7 +2,7 @@ from trezor import ui, workflow from trezor.crypto import bip39, slip39 from trezor.messages import BackupType -from apps.common import storage +from apps.common.storage import device as storage_device if False: from typing import Optional, Tuple @@ -14,11 +14,11 @@ def get() -> Tuple[Optional[bytes], int]: def get_secret() -> Optional[bytes]: - return storage.device.get_mnemonic_secret() + return storage_device.get_mnemonic_secret() def get_type() -> EnumTypeBackupType: - return storage.device.get_backup_type() + return storage_device.get_backup_type() def is_bip39() -> bool: @@ -43,8 +43,8 @@ def get_seed(passphrase: str = "", progress_bar: bool = True) -> bytes: seed = bip39.seed(mnemonic_secret.decode(), passphrase, render_func) else: # SLIP-39 - identifier = storage.device.get_slip39_identifier() - iteration_exponent = storage.device.get_slip39_iteration_exponent() + identifier = storage_device.get_slip39_identifier() + iteration_exponent = storage_device.get_slip39_iteration_exponent() if identifier is None or iteration_exponent is None: # Identifier or exponent expected but not found raise RuntimeError diff --git a/core/src/apps/common/request_passphrase.py b/core/src/apps/common/request_passphrase.py index d55eb97fcc..34395683c2 100644 --- a/core/src/apps/common/request_passphrase.py +++ b/core/src/apps/common/request_passphrase.py @@ -12,7 +12,8 @@ from trezor.ui.passphrase import CANCELLED, PassphraseKeyboard, PassphraseSource from trezor.ui.popup import Popup from trezor.ui.text import Text -from apps.common import cache, storage +from apps.common import cache +from apps.common.storage import device as storage_device if __debug__: from apps.debug import input_signal @@ -21,14 +22,14 @@ _MAX_PASSPHRASE_LEN = const(50) async def protect_by_passphrase(ctx: wire.Context) -> str: - if storage.device.has_passphrase(): + if storage_device.has_passphrase(): return await request_passphrase(ctx) else: return "" async def request_passphrase(ctx: wire.Context) -> str: - source = storage.device.get_passphrase_source() + source = storage_device.get_passphrase_source() if source == PassphraseSourceType.ASK: source = await request_passphrase_source(ctx) passphrase = await request_passphrase_ack( @@ -47,7 +48,9 @@ async def request_passphrase_source(ctx: wire.Context) -> int: text.normal("Where do you want to", "enter your passphrase?") source = PassphraseSource(text) - return await ctx.wait(source) + response = await ctx.wait(source) + assert isinstance(response, int) + return response async def request_passphrase_ack(ctx: wire.Context, on_device: bool) -> str: @@ -56,8 +59,8 @@ async def request_passphrase_ack(ctx: wire.Context, on_device: bool) -> str: text.normal("Please type your", "passphrase on the", "connected host.") await Popup(text) - req = PassphraseRequest(on_device=on_device) - ack = await ctx.call(req, PassphraseAck) + passphrase_request = PassphraseRequest(on_device=on_device) + ack = await ctx.call(passphrase_request, PassphraseAck) if on_device: if ack.passphrase is not None: @@ -75,8 +78,10 @@ async def request_passphrase_ack(ctx: wire.Context, on_device: bool) -> str: raise wire.ProcessError("Passphrase not provided") passphrase = ack.passphrase + assert isinstance(passphrase, str) + state = cache.get_state(prev_state=ack.state, passphrase=passphrase) - req = PassphraseStateRequest(state=state) - ack = await ctx.call(req, PassphraseStateAck) + state_request = PassphraseStateRequest(state=state) + await ctx.call(state_request, PassphraseStateAck) return passphrase diff --git a/core/src/apps/common/request_pin.py b/core/src/apps/common/request_pin.py index 9ad537e329..4b4a77641a 100644 --- a/core/src/apps/common/request_pin.py +++ b/core/src/apps/common/request_pin.py @@ -41,18 +41,21 @@ async def request_pin( while True: if __debug__: - result = await loop.race(dialog, input_signal()) + pin = await loop.race(dialog, input_signal()) else: - result = await dialog - if result is CANCELLED: + pin = await dialog + if pin is CANCELLED: raise PinCancelled - return result + assert isinstance(pin, str) + return pin async def request_pin_ack(ctx: wire.Context, *args: Any, **kwargs: Any) -> str: try: await ctx.call(ButtonRequest(code=ButtonRequestType.Other), ButtonAck) - return await ctx.wait(request_pin(*args, **kwargs)) + pin = await ctx.wait(request_pin(*args, **kwargs)) + assert isinstance(pin, str) + return pin except PinCancelled: raise wire.ActionCancelled("Cancelled") diff --git a/core/src/apps/common/sd_salt.py b/core/src/apps/common/sd_salt.py index b0e06d69b5..9fa47e176d 100644 --- a/core/src/apps/common/sd_salt.py +++ b/core/src/apps/common/sd_salt.py @@ -7,8 +7,8 @@ from trezor.ui.confirm import CONFIRMED, Confirm from trezor.ui.text import Text from trezor.utils import consteq -from apps.common import storage from apps.common.confirm import confirm +from apps.common.storage.device import get_device_id if False: from typing import Optional @@ -78,7 +78,7 @@ async def _write_failed_dialog(ctx: Optional[wire.Context]) -> None: def _get_device_dir() -> str: - return "/trezor/device_%s" % storage.device.get_device_id().lower() + return "/trezor/device_%s" % get_device_id().lower() def _get_salt_path(new: bool = False) -> str: diff --git a/core/src/apps/common/seed.py b/core/src/apps/common/seed.py index d77d1ad4ec..c74cb08791 100644 --- a/core/src/apps/common/seed.py +++ b/core/src/apps/common/seed.py @@ -97,6 +97,7 @@ class Keychain: def derive_slip77_blinding_private_key(self, script: bytes) -> bytes: """Following the derivation by Elements/Liquid.""" master_node = self.derive(node_path=[b"SLIP-0077"], curve_name="slip21") + assert isinstance(master_node, Slip21Node) return hmac.new( key=master_node.key(), msg=script, digestmod=hashlib.sha256 ).digest() diff --git a/core/src/apps/common/storage/device.py b/core/src/apps/common/storage/device.py index e71990515b..16a13417a6 100644 --- a/core/src/apps/common/storage/device.py +++ b/core/src/apps/common/storage/device.py @@ -96,7 +96,7 @@ def get_backup_type() -> EnumTypeBackupType: ): # Invalid backup type raise RuntimeError - return backup_type + return backup_type # type: ignore def has_passphrase() -> bool: diff --git a/core/src/apps/common/storage/recovery.py b/core/src/apps/common/storage/recovery.py index c2b850cbbb..e178c36927 100644 --- a/core/src/apps/common/storage/recovery.py +++ b/core/src/apps/common/storage/recovery.py @@ -29,7 +29,7 @@ if False: from typing import List, Optional -def _require_progress(): +def _require_progress() -> None: if not is_in_progress(): raise RuntimeError @@ -77,7 +77,7 @@ def set_slip39_group_count(group_count: int) -> None: common.set_uint8(_NAMESPACE, _SLIP39_GROUP_COUNT, group_count) -def get_slip39_group_count() -> Optional[int]: +def get_slip39_group_count() -> int: _require_progress() return ( common.get_uint8(_NAMESPACE, _SLIP39_GROUP_COUNT) or _DEFAULT_SLIP39_GROUP_COUNT diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index b0b1aa4769..98636fcd84 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -28,7 +28,7 @@ if __debug__: debuglink_decision_chan = loop.chan() - async def debuglink_decision_dispatcher(): + async def debuglink_decision_dispatcher() -> None: from trezor.ui import confirm, swipe while True: @@ -64,12 +64,13 @@ if __debug__: ctx: wire.Context, msg: DebugLinkGetState ) -> DebugLinkState: from trezor.messages.DebugLinkState import DebugLinkState - from apps.common import storage, mnemonic + from apps.common import mnemonic + from apps.common.storage.device import has_passphrase m = DebugLinkState() m.mnemonic_secret = mnemonic.get_secret() m.mnemonic_type = mnemonic.get_type() - m.passphrase_protection = storage.device.has_passphrase() + m.passphrase_protection = has_passphrase() m.reset_entropy = reset_internal_entropy if msg.wait_word_pos: diff --git a/core/src/apps/homescreen/__init__.py b/core/src/apps/homescreen/__init__.py index 4d8e78598c..8c8c44e28a 100644 --- a/core/src/apps/homescreen/__init__.py +++ b/core/src/apps/homescreen/__init__.py @@ -5,6 +5,7 @@ from trezor.messages.Success import Success from trezor.wire import register from apps.common import cache, mnemonic, storage +from apps.common.storage import device as storage_device, recovery as storage_recovery if False: from typing import NoReturn @@ -22,20 +23,20 @@ def get_features() -> Features: f.major_version = utils.VERSION_MAJOR f.minor_version = utils.VERSION_MINOR f.patch_version = utils.VERSION_PATCH - f.revision = utils.GITREV + f.revision = utils.GITREV.encode() f.model = utils.MODEL - f.device_id = storage.device.get_device_id() - f.label = storage.device.get_label() + f.device_id = storage_device.get_device_id() + f.label = storage_device.get_label() f.initialized = storage.is_initialized() f.pin_protection = config.has_pin() f.pin_cached = config.has_pin() - f.passphrase_protection = storage.device.has_passphrase() + f.passphrase_protection = storage_device.has_passphrase() f.passphrase_cached = cache.has_passphrase() - f.needs_backup = storage.device.needs_backup() - f.unfinished_backup = storage.device.unfinished_backup() - f.no_backup = storage.device.no_backup() - f.flags = storage.device.get_flags() - f.recovery_mode = storage.recovery.is_in_progress() + f.needs_backup = storage_device.needs_backup() + f.unfinished_backup = storage_device.unfinished_backup() + f.no_backup = storage_device.no_backup() + f.flags = storage_device.get_flags() + f.recovery_mode = storage_recovery.is_in_progress() f.backup_type = mnemonic.get_type() if utils.BITCOIN_ONLY: f.capabilities = [ diff --git a/core/src/apps/homescreen/homescreen.py b/core/src/apps/homescreen/homescreen.py index 8c8cf65d27..7533ecbe55 100644 --- a/core/src/apps/homescreen/homescreen.py +++ b/core/src/apps/homescreen/homescreen.py @@ -1,6 +1,7 @@ from trezor import config, res, ui from apps.common import storage +from apps.common.storage import device as storage_device async def homescreen() -> None: @@ -8,10 +9,10 @@ async def homescreen() -> None: class Homescreen(ui.Layout): - def __init__(self): + def __init__(self) -> None: self.repaint = True - def on_render(self): + def on_render(self) -> None: if not self.repaint: return @@ -19,17 +20,17 @@ class Homescreen(ui.Layout): if not storage.is_initialized(): label = "Go to trezor.io/start" else: - label = storage.device.get_label() or "My Trezor" - image = storage.device.get_homescreen() + label = storage_device.get_label() or "My Trezor" + image = storage_device.get_homescreen() if not image: image = res.load("apps/homescreen/res/bg.toif") - if storage.is_initialized() and storage.device.no_backup(): + if storage.is_initialized() and storage_device.no_backup(): ui.header_error("SEEDLESS") - elif storage.is_initialized() and storage.device.unfinished_backup(): + elif storage.is_initialized() and storage_device.unfinished_backup(): ui.header_error("BACKUP FAILED!") - elif storage.is_initialized() and storage.device.needs_backup(): + elif storage.is_initialized() and storage_device.needs_backup(): ui.header_warning("NEEDS BACKUP!") elif storage.is_initialized() and not config.has_pin(): ui.header_warning("PIN NOT SET!") diff --git a/core/src/apps/management/apply_flags.py b/core/src/apps/management/apply_flags.py index a9fd1c9fa0..cde6e7af97 100644 --- a/core/src/apps/management/apply_flags.py +++ b/core/src/apps/management/apply_flags.py @@ -1,8 +1,8 @@ from trezor.messages.Success import Success -from apps.common import storage +from apps.common.storage.device import set_flags async def apply_flags(ctx, msg): - storage.device.set_flags(msg.flags) + set_flags(msg.flags) return Success(message="Flags applied") diff --git a/core/src/apps/management/apply_settings.py b/core/src/apps/management/apply_settings.py index f6f9ce5441..3913287898 100644 --- a/core/src/apps/management/apply_settings.py +++ b/core/src/apps/management/apply_settings.py @@ -3,8 +3,8 @@ from trezor.messages import ButtonRequestType, PassphraseSourceType from trezor.messages.Success import Success from trezor.ui.text import Text -from apps.common import storage from apps.common.confirm import require_confirm +from apps.common.storage import device as storage_device async def apply_settings(ctx, msg): @@ -18,7 +18,7 @@ async def apply_settings(ctx, msg): raise wire.ProcessError("No setting provided") if msg.homescreen is not None: - if len(msg.homescreen) > storage.device.HOMESCREEN_MAXSIZE: + if len(msg.homescreen) > storage_device.HOMESCREEN_MAXSIZE: raise wire.DataError("Homescreen is too complex") await require_confirm_change_homescreen(ctx) @@ -34,7 +34,7 @@ async def apply_settings(ctx, msg): if msg.display_rotation is not None: await require_confirm_change_display_rotation(ctx, msg.display_rotation) - storage.device.load_settings( + storage_device.load_settings( label=msg.label, use_passphrase=msg.use_passphrase, homescreen=msg.homescreen, @@ -43,7 +43,7 @@ async def apply_settings(ctx, msg): ) if msg.display_rotation is not None: - ui.display.orientation(storage.device.get_rotation()) + ui.display.orientation(storage_device.get_rotation()) return Success(message="Settings applied") diff --git a/core/src/apps/management/backup_device.py b/core/src/apps/management/backup_device.py index 59ba2a920c..9b80c88acd 100644 --- a/core/src/apps/management/backup_device.py +++ b/core/src/apps/management/backup_device.py @@ -2,23 +2,24 @@ from trezor import wire from trezor.messages.Success import Success from apps.common import mnemonic, storage +from apps.common.storage import device as storage_device from apps.management.reset_device import backup_seed, layout async def backup_device(ctx, msg): if not storage.is_initialized(): raise wire.NotInitialized("Device is not initialized") - if not storage.device.needs_backup(): + if not storage_device.needs_backup(): raise wire.ProcessError("Seed already backed up") mnemonic_secret, mnemonic_type = mnemonic.get() - storage.device.set_unfinished_backup(True) - storage.device.set_backed_up() + storage_device.set_unfinished_backup(True) + storage_device.set_backed_up() await backup_seed(ctx, mnemonic_type, mnemonic_secret) - storage.device.set_unfinished_backup(False) + storage_device.set_unfinished_backup(False) await layout.show_backup_success(ctx) diff --git a/core/src/apps/management/backup_types.py b/core/src/apps/management/backup_types.py index 0bfd37332b..3a268b66c0 100644 --- a/core/src/apps/management/backup_types.py +++ b/core/src/apps/management/backup_types.py @@ -22,7 +22,7 @@ def is_slip39_word_count(word_count: int) -> bool: raise RuntimeError -def is_slip39_backup_type(backup_type: EnumTypeBackupType): +def is_slip39_backup_type(backup_type: EnumTypeBackupType) -> bool: return backup_type in (BackupType.Slip39_Basic, BackupType.Slip39_Advanced) diff --git a/core/src/apps/management/load_device.py b/core/src/apps/management/load_device.py index 1c7b7baabf..010aa40a36 100644 --- a/core/src/apps/management/load_device.py +++ b/core/src/apps/management/load_device.py @@ -7,6 +7,7 @@ from trezor.ui.text import Text from apps.common import storage from apps.common.confirm import require_confirm +from apps.common.storage import device as storage_device from apps.management import backup_types @@ -32,13 +33,13 @@ async def load_device(ctx, msg): backup_type = BackupType.Slip39_Advanced else: raise RuntimeError("Invalid group count") - storage.device.set_slip39_identifier(identifier) - storage.device.set_slip39_iteration_exponent(iteration_exponent) + storage_device.set_slip39_identifier(identifier) + storage_device.set_slip39_iteration_exponent(iteration_exponent) - storage.device.store_mnemonic_secret( + storage_device.store_mnemonic_secret( secret, backup_type, needs_backup=True, no_backup=False ) - storage.device.load_settings( + storage_device.load_settings( use_passphrase=msg.passphrase_protection, label=msg.label ) if msg.pin: diff --git a/core/src/apps/management/recovery_device/__init__.py b/core/src/apps/management/recovery_device/__init__.py index bacd712b2a..fc77769cdd 100644 --- a/core/src/apps/management/recovery_device/__init__.py +++ b/core/src/apps/management/recovery_device/__init__.py @@ -11,6 +11,7 @@ from apps.common.request_pin import ( request_pin_confirm, show_pin_invalid, ) +from apps.common.storage import device as storage_device, recovery as storage_recovery from apps.management.recovery_device.homescreen import recovery_process if False: @@ -43,13 +44,13 @@ async def recovery_device(ctx: wire.Context, msg: RecoveryDevice) -> Success: config.change_pin(pin_to_int(""), pin_to_int(newpin), None, None) if msg.u2f_counter: - storage.device.set_u2f_counter(msg.u2f_counter) - storage.device.load_settings( + storage_device.set_u2f_counter(msg.u2f_counter) + storage_device.load_settings( label=msg.label, use_passphrase=msg.passphrase_protection ) - storage.recovery.set_in_progress(True) + storage_recovery.set_in_progress(True) if msg.dry_run: - storage.recovery.set_dry_run(msg.dry_run) + storage_recovery.set_dry_run(msg.dry_run) result = await recovery_process(ctx) @@ -62,7 +63,7 @@ def _check_state(msg: RecoveryDevice) -> None: if msg.dry_run and not storage.is_initialized(): raise wire.NotInitialized("Device is not initialized") - if storage.recovery.is_in_progress(): + if storage_recovery.is_in_progress(): raise RuntimeError( "Function recovery_device should not be invoked when recovery is already in progress" ) @@ -73,7 +74,7 @@ def _check_state(msg: RecoveryDevice) -> None: ) -async def _continue_dialog(ctx: wire.Context, msg: RecoveryDevice): +async def _continue_dialog(ctx: wire.Context, msg: RecoveryDevice) -> None: if not msg.dry_run: text = Text("Recovery mode", ui.ICON_RECOVERY, new_lines=False) text.bold("Do you really want to") diff --git a/core/src/apps/management/recovery_device/homescreen.py b/core/src/apps/management/recovery_device/homescreen.py index e82230ee8d..05a22d5c1c 100644 --- a/core/src/apps/management/recovery_device/homescreen.py +++ b/core/src/apps/management/recovery_device/homescreen.py @@ -9,17 +9,22 @@ from . import recover from apps.common import mnemonic, storage from apps.common.layout import show_success +from apps.common.storage import ( + device as storage_device, + recovery as storage_recovery, + recovery_shares as storage_recovery_shares, +) from apps.management import backup_types from apps.management.recovery_device import layout if False: - from typing import Optional, Tuple + from typing import Optional, Tuple, cast from trezor.messages.ResetDevice import EnumTypeBackupType async def recovery_homescreen() -> None: # recovery process does not communicate on the wire - ctx = wire.DummyContext() + ctx = cast(wire.Context, wire.DummyContext()) # TODO try: await recovery_process(ctx) finally: @@ -33,9 +38,9 @@ async def recovery_process(ctx: wire.Context) -> Success: try: result = await _continue_recovery_process(ctx) except recover.RecoveryAborted: - dry_run = storage.recovery.is_dry_run() + dry_run = storage_recovery.is_dry_run() if dry_run: - storage.recovery.end_progress() + storage_recovery.end_progress() else: storage.wipe() raise wire.ActionCancelled("Cancelled") @@ -44,7 +49,7 @@ async def recovery_process(ctx: wire.Context) -> Success: async def _continue_recovery_process(ctx: wire.Context) -> Success: # gather the current recovery state from storage - dry_run = storage.recovery.is_dry_run() + dry_run = storage_recovery.is_dry_run() word_count, backup_type = recover.load_slip39_state() # Both word_count and backup_type are derived from the same data. Both will be @@ -54,6 +59,7 @@ async def _continue_recovery_process(ctx: wire.Context) -> Success: is_first_step = backup_type is None if not is_first_step: + assert word_count is not None # If we continue recovery, show starting screen with word count immediately. await _request_share_first_screen(ctx, word_count) @@ -64,6 +70,7 @@ async def _continue_recovery_process(ctx: wire.Context) -> Success: word_count = await _request_word_count(ctx, dry_run) # ...and only then show the starting screen with word count. await _request_share_first_screen(ctx, word_count) + assert word_count is not None # ask for mnemonic words one by one words = await layout.request_mnemonic(ctx, word_count, backup_type) @@ -81,6 +88,7 @@ async def _continue_recovery_process(ctx: wire.Context) -> Success: except MnemonicError: await layout.show_invalid_mnemonic(ctx, word_count) + assert backup_type is not None if dry_run: result = await _finish_recovery_dry_run(ctx, secret, backup_type) else: @@ -104,17 +112,17 @@ async def _finish_recovery_dry_run( # Check that the identifier and iteration exponent match as well if is_slip39: result &= ( - storage.device.get_slip39_identifier() - == storage.recovery.get_slip39_identifier() + storage_device.get_slip39_identifier() + == storage_recovery.get_slip39_identifier() ) result &= ( - storage.device.get_slip39_iteration_exponent() - == storage.recovery.get_slip39_iteration_exponent() + storage_device.get_slip39_iteration_exponent() + == storage_recovery.get_slip39_iteration_exponent() ) await layout.show_dry_run_result(ctx, result, is_slip39) - storage.recovery.end_progress() + storage_recovery.end_progress() if result: return Success("The seed is valid and matches the one in the device") @@ -128,21 +136,21 @@ async def _finish_recovery( if backup_type is None: raise RuntimeError - storage.device.store_mnemonic_secret( + storage_device.store_mnemonic_secret( secret, backup_type, needs_backup=False, no_backup=False ) if backup_type in (BackupType.Slip39_Basic, BackupType.Slip39_Advanced): - identifier = storage.recovery.get_slip39_identifier() - exponent = storage.recovery.get_slip39_iteration_exponent() + identifier = storage_recovery.get_slip39_identifier() + exponent = storage_recovery.get_slip39_iteration_exponent() if identifier is None or exponent is None: # Identifier and exponent need to be stored in storage at this point raise RuntimeError - storage.device.set_slip39_identifier(identifier) - storage.device.set_slip39_iteration_exponent(exponent) + storage_device.set_slip39_identifier(identifier) + storage_device.set_slip39_iteration_exponent(exponent) await show_success(ctx, ("You have successfully", "recovered your wallet.")) - storage.recovery.end_progress() + storage_recovery.end_progress() return Success(message="Device recovered") @@ -162,12 +170,13 @@ async def _process_words( share = None if not is_slip39: # BIP-39 - secret = recover.process_bip39(words) + secret = recover.process_bip39(words) # type: Optional[bytes] else: secret, share = recover.process_slip39(words) backup_type = backup_types.infer_backup_type(is_slip39, share) - if secret is None: + if secret is None: # SLIP-39 + assert share is not None if share.group_count and share.group_count > 1: await layout.show_group_share_success(ctx, share.index, share.group_index) await _request_share_next_screen(ctx) @@ -177,7 +186,7 @@ async def _process_words( async def _request_share_first_screen(ctx: wire.Context, word_count: int) -> None: if backup_types.is_slip39_word_count(word_count): - remaining = storage.recovery.fetch_slip39_remaining_shares() + remaining = storage_recovery.fetch_slip39_remaining_shares() if remaining: await _request_share_next_screen(ctx) else: @@ -193,8 +202,8 @@ async def _request_share_first_screen(ctx: wire.Context, word_count: int) -> Non async def _request_share_next_screen(ctx: wire.Context) -> None: - remaining = storage.recovery.fetch_slip39_remaining_shares() - group_count = storage.recovery.get_slip39_group_count() + remaining = storage_recovery.fetch_slip39_remaining_shares() + group_count = storage_recovery.get_slip39_group_count() if not remaining: # 'remaining' should be stored at this point raise RuntimeError @@ -217,7 +226,9 @@ async def _show_remaining_groups_and_shares(ctx: wire.Context) -> None: """ Show info dialog for Slip39 Advanced - what shares are to be entered. """ - shares_remaining = storage.recovery.fetch_slip39_remaining_shares() + shares_remaining = storage_recovery.fetch_slip39_remaining_shares() + # should be stored at this point + assert shares_remaining groups = set() first_entered_index = -1 @@ -228,17 +239,18 @@ async def _show_remaining_groups_and_shares(ctx: wire.Context) -> None: share = None for index, remaining in enumerate(shares_remaining): if 0 <= remaining < slip39.MAX_SHARE_COUNT: - m = storage.recovery_shares.fetch_group(index)[0] + m = storage_recovery_shares.fetch_group(index)[0] if not share: share = slip39.decode_mnemonic(m) identifier = m.split(" ")[0:3] groups.add((remaining, tuple(identifier))) elif remaining == slip39.MAX_SHARE_COUNT: # no shares yet - identifier = storage.recovery_shares.fetch_group(first_entered_index)[ + identifier = storage_recovery_shares.fetch_group(first_entered_index)[ 0 ].split(" ")[0:2] groups.add((remaining, tuple(identifier))) + assert share # share needs to be set return await layout.show_remaining_shares( ctx, groups, shares_remaining, share.group_threshold ) diff --git a/core/src/apps/management/recovery_device/layout.py b/core/src/apps/management/recovery_device/layout.py index fe061c1e4f..c56e2ee5ee 100644 --- a/core/src/apps/management/recovery_device/layout.py +++ b/core/src/apps/management/recovery_device/layout.py @@ -11,9 +11,9 @@ from .keyboard_bip39 import Bip39Keyboard from .keyboard_slip39 import Slip39Keyboard from .recover import RecoveryAborted -from apps.common import storage from apps.common.confirm import confirm, info_confirm, require_confirm from apps.common.layout import show_success, show_warning +from apps.common.storage import recovery as storage_recovery from apps.management import backup_types from apps.management.recovery_device import recover @@ -21,7 +21,7 @@ if __debug__: from apps.debug import input_signal if False: - from typing import List, Optional, Callable, Iterable, Tuple + from typing import List, Optional, Callable, Iterable, Tuple, Union from trezor.messages.ResetDevice import EnumTypeBackupType @@ -51,7 +51,7 @@ async def request_word_count(ctx: wire.Context, dry_run: bool) -> int: else: count = await ctx.wait(WordSelector(text)) - return count + return count # type: ignore async def request_mnemonic( @@ -59,10 +59,12 @@ async def request_mnemonic( ) -> Optional[str]: await ctx.call(ButtonRequest(code=ButtonRequestType.MnemonicInput), ButtonAck) - words = [] + words = [] # type: List[str] for i in range(word_count): if backup_types.is_slip39_word_count(word_count): - keyboard = Slip39Keyboard("Type word %s of %s:" % (i + 1, word_count)) + keyboard = Slip39Keyboard( + "Type word %s of %s:" % (i + 1, word_count) + ) # type: Union[Slip39Keyboard, Bip39Keyboard] else: keyboard = Bip39Keyboard("Type word %s of %s:" % (i + 1, word_count)) if __debug__: @@ -125,8 +127,10 @@ async def check_word_validity( if len(group) > 0: if current_word == group[0].split(" ")[current_index]: remaining_shares = ( - storage.recovery.fetch_slip39_remaining_shares() + storage_recovery.fetch_slip39_remaining_shares() ) + # if backup_type is not None, some share was already entered -> remaining needs to be set + assert remaining_shares is not None if remaining_shares[i] == 0: await show_group_threshold_reached(ctx) return False @@ -152,11 +156,11 @@ async def check_word_validity( async def show_remaining_shares( ctx: wire.Context, - groups: Iterable[Tuple[int, Tuple[str]]], # remaining + list 3 words + groups: Iterable[Tuple[int, Tuple[str, ...]]], # remaining + list 3 words shares_remaining: List[int], group_threshold: int, ) -> None: - pages = [] + pages = [] # type: List[ui.Component] for remaining, group in groups: if 0 < remaining < MAX_SHARE_COUNT: text = Text("Remaining Shares") @@ -179,8 +183,7 @@ async def show_remaining_shares( for word in group: text.normal(word) pages.append(text) - - return await confirm(ctx, Paginated(pages), cancel=None) + await confirm(ctx, Paginated(pages), cancel=None) async def show_group_share_success( @@ -192,7 +195,7 @@ async def show_group_share_success( text.normal("from") text.bold("Group %s" % (group_index + 1)) - return await confirm(ctx, text, confirm="Continue", cancel=None) + await confirm(ctx, text, confirm="Continue", cancel=None) async def show_dry_run_result(ctx: wire.Context, result: bool, is_slip39: bool) -> None: @@ -275,7 +278,7 @@ class RecoveryHomescreen(ui.Component): def __init__(self, text: str, subtext: str = None): self.text = text self.subtext = subtext - self.dry_run = storage.recovery.is_dry_run() + self.dry_run = storage_recovery.is_dry_run() self.repaint = True def on_render(self) -> None: @@ -335,6 +338,6 @@ async def homescreen_dialog( # go forward in the recovery process break # user has chosen to abort, confirm the choice - dry_run = storage.recovery.is_dry_run() + dry_run = storage_recovery.is_dry_run() if await confirm_abort(ctx, dry_run): raise RecoveryAborted diff --git a/core/src/apps/management/recovery_device/recover.py b/core/src/apps/management/recovery_device/recover.py index 83975270c7..4b4eeb565f 100644 --- a/core/src/apps/management/recovery_device/recover.py +++ b/core/src/apps/management/recovery_device/recover.py @@ -1,12 +1,15 @@ from trezor.crypto import bip39, slip39 from trezor.errors import MnemonicError -from apps.common import storage +from apps.common.storage import ( + recovery as storage_recovery, + recovery_shares as storage_recovery_shares, +) from apps.management import backup_types if False: from trezor.messages.ResetDevice import EnumTypeBackupType - from typing import Optional, Tuple, List + from typing import Optional, Tuple, List, Union class RecoveryAborted(Exception): @@ -30,17 +33,17 @@ def process_slip39(words: str) -> Tuple[Optional[bytes], slip39.Share]: """ share = slip39.decode_mnemonic(words) - remaining = storage.recovery.fetch_slip39_remaining_shares() + remaining = storage_recovery.fetch_slip39_remaining_shares() # if this is the first share, parse and store metadata if not remaining: - storage.recovery.set_slip39_group_count(share.group_count) - storage.recovery.set_slip39_iteration_exponent(share.iteration_exponent) - storage.recovery.set_slip39_identifier(share.identifier) - storage.recovery.set_slip39_remaining_shares( + storage_recovery.set_slip39_group_count(share.group_count) + storage_recovery.set_slip39_iteration_exponent(share.iteration_exponent) + storage_recovery.set_slip39_identifier(share.identifier) + storage_recovery.set_slip39_remaining_shares( share.threshold - 1, share.group_index ) - storage.recovery_shares.set(share.index, share.group_index, words) + storage_recovery_shares.set(share.index, share.group_index, words) # if share threshold and group threshold are 1 # we can calculate the secret right away @@ -54,24 +57,24 @@ def process_slip39(words: str) -> Tuple[Optional[bytes], slip39.Share]: return None, share # These should be checked by UI before so it's a Runtime exception otherwise - if share.identifier != storage.recovery.get_slip39_identifier(): + if share.identifier != storage_recovery.get_slip39_identifier(): raise RuntimeError("Slip39: Share identifiers do not match") - if share.iteration_exponent != storage.recovery.get_slip39_iteration_exponent(): + if share.iteration_exponent != storage_recovery.get_slip39_iteration_exponent(): raise RuntimeError("Slip39: Share exponents do not match") - if storage.recovery_shares.get(share.index, share.group_index): + if storage_recovery_shares.get(share.index, share.group_index): raise RuntimeError("Slip39: This mnemonic was already entered") - if share.group_count != storage.recovery.get_slip39_group_count(): + if share.group_count != storage_recovery.get_slip39_group_count(): raise RuntimeError("Slip39: Group count does not match") remaining_for_share = ( - storage.recovery.get_slip39_remaining_shares(share.group_index) + storage_recovery.get_slip39_remaining_shares(share.group_index) or share.threshold ) - storage.recovery.set_slip39_remaining_shares( + storage_recovery.set_slip39_remaining_shares( remaining_for_share - 1, share.group_index ) remaining[share.group_index] = remaining_for_share - 1 - storage.recovery_shares.set(share.index, share.group_index, words) + storage_recovery_shares.set(share.index, share.group_index, words) if remaining.count(0) < share.group_threshold: # we need more shares @@ -82,17 +85,21 @@ def process_slip39(words: str) -> Tuple[Optional[bytes], slip39.Share]: for i, r in enumerate(remaining): # if we have multiple groups pass only the ones with threshold reached if r == 0: - group = storage.recovery_shares.fetch_group(i) + group = storage_recovery_shares.fetch_group(i) mnemonics.extend(group) else: # in case of slip39 basic we only need the first and only group - mnemonics = storage.recovery_shares.fetch_group(0) + mnemonics = storage_recovery_shares.fetch_group(0) identifier, iteration_exponent, secret, _ = slip39.combine_mnemonics(mnemonics) return secret, share -def load_slip39_state() -> Tuple[Optional[int], Optional[EnumTypeBackupType]]: +if False: + Slip39State = Union[Tuple[int, EnumTypeBackupType], Tuple[None, None]] + + +def load_slip39_state() -> Slip39State: previous_mnemonics = fetch_previous_mnemonics() if not previous_mnemonics: return None, None @@ -105,10 +112,10 @@ def load_slip39_state() -> Tuple[Optional[int], Optional[EnumTypeBackupType]]: def fetch_previous_mnemonics() -> Optional[List[List[str]]]: mnemonics = [] - if not storage.recovery.get_slip39_group_count(): + if not storage_recovery.get_slip39_group_count(): return None - for i in range(storage.recovery.get_slip39_group_count()): - mnemonics.append(storage.recovery_shares.fetch_group(i)) + for i in range(storage_recovery.get_slip39_group_count()): + mnemonics.append(storage_recovery_shares.fetch_group(i)) if not any(p for p in mnemonics): return None return mnemonics diff --git a/core/src/apps/management/reset_device/__init__.py b/core/src/apps/management/reset_device/__init__.py index 02a59f0cce..b046e0bf7e 100644 --- a/core/src/apps/management/reset_device/__init__.py +++ b/core/src/apps/management/reset_device/__init__.py @@ -7,6 +7,7 @@ from trezor.messages.Success import Success from trezor.pin import pin_to_int from apps.common import storage +from apps.common.storage import device as storage_device from apps.management import backup_types from apps.management.change_pin import request_pin_confirm from apps.management.reset_device import layout @@ -52,8 +53,8 @@ async def reset_device(ctx: wire.Context, msg: ResetDevice) -> Success: secret = bip39.from_data(secret).encode() elif msg.backup_type in (BackupType.Slip39_Basic, BackupType.Slip39_Advanced): # generate and set SLIP39 parameters - storage.device.set_slip39_identifier(slip39.generate_random_identifier()) - storage.device.set_slip39_iteration_exponent(slip39.DEFAULT_ITERATION_EXPONENT) + storage_device.set_slip39_identifier(slip39.generate_random_identifier()) + storage_device.set_slip39_iteration_exponent(slip39.DEFAULT_ITERATION_EXPONENT) else: # Unknown backup type. raise RuntimeError @@ -71,10 +72,10 @@ async def reset_device(ctx: wire.Context, msg: ResetDevice) -> Success: await backup_seed(ctx, msg.backup_type, secret) # write settings and master secret into storage - storage.device.load_settings( + storage_device.load_settings( label=msg.label, use_passphrase=msg.passphrase_protection ) - storage.device.store_mnemonic_secret( + storage_device.store_mnemonic_secret( secret, # for SLIP-39, this is the EMS msg.backup_type, needs_backup=not perform_backup, @@ -102,10 +103,10 @@ async def backup_slip39_basic( # generate the mnemonics mnemonics = slip39.generate_mnemonics_from_data( encrypted_master_secret, - storage.device.get_slip39_identifier(), + storage_device.get_slip39_identifier(), 1, # Single Group threshold [(threshold, shares_count)], # Single Group threshold/count - storage.device.get_slip39_iteration_exponent(), + storage_device.get_slip39_iteration_exponent(), )[0] # show and confirm individual shares @@ -137,10 +138,10 @@ async def backup_slip39_advanced( # generate the mnemonics mnemonics = slip39.generate_mnemonics_from_data( encrypted_master_secret=encrypted_master_secret, - identifier=storage.device.get_slip39_identifier(), + identifier=storage_device.get_slip39_identifier(), group_threshold=group_threshold, groups=groups, - iteration_exponent=storage.device.get_slip39_iteration_exponent(), + iteration_exponent=storage_device.get_slip39_iteration_exponent(), ) # show and confirm individual shares diff --git a/core/src/apps/management/set_u2f_counter.py b/core/src/apps/management/set_u2f_counter.py index 97a61288c7..a29b9389be 100644 --- a/core/src/apps/management/set_u2f_counter.py +++ b/core/src/apps/management/set_u2f_counter.py @@ -3,8 +3,8 @@ from trezor.messages import ButtonRequestType from trezor.messages.Success import Success from trezor.ui.text import Text -from apps.common import storage from apps.common.confirm import require_confirm +from apps.common.storage import device as storage_device async def set_u2f_counter(ctx, msg): @@ -16,6 +16,6 @@ async def set_u2f_counter(ctx, msg): text.bold("to %d?" % msg.u2f_counter) await require_confirm(ctx, text, code=ButtonRequestType.ProtectCall) - storage.device.set_u2f_counter(msg.u2f_counter) + storage_device.set_u2f_counter(msg.u2f_counter) return Success(message="U2F counter set") diff --git a/core/src/apps/monero/__init__.py b/core/src/apps/monero/__init__.py index 9f774b0f38..94f08884e7 100644 --- a/core/src/apps/monero/__init__.py +++ b/core/src/apps/monero/__init__.py @@ -22,7 +22,7 @@ def boot() -> None: wire.add(MessageType.DebugMoneroDiagRequest, __name__, "diag") -def live_refresh_token(token=None): +def live_refresh_token(token: bytes = None) -> None: global _LIVE_REFRESH_TOKEN if token is None: return _LIVE_REFRESH_TOKEN diff --git a/core/src/apps/webauthn/credential.py b/core/src/apps/webauthn/credential.py index 31b0f142cd..f6b4500b1e 100644 --- a/core/src/apps/webauthn/credential.py +++ b/core/src/apps/webauthn/credential.py @@ -5,7 +5,8 @@ from ubinascii import hexlify from trezor import log, utils from trezor.crypto import bip32, chacha20poly1305, hashlib, hmac, random -from apps.common import HARDENED, cbor, seed, storage +from apps.common import HARDENED, cbor, seed +from apps.common.storage import device as storage_device if False: from typing import Optional @@ -50,7 +51,7 @@ class Credential: return None def next_signature_counter(self) -> int: - return storage.device.next_u2f_counter() or 0 + return storage_device.next_u2f_counter() or 0 @staticmethod def from_bytes(data: bytes, rp_id_hash: bytes) -> Optional["Credential"]: @@ -82,7 +83,7 @@ class Fido2Credential(Credential): return True def generate_id(self) -> None: - self.creation_time = storage.device.next_u2f_counter() or 0 + self.creation_time = storage_device.next_u2f_counter() or 0 data = cbor.encode( { diff --git a/core/src/boot.py b/core/src/boot.py index 191791dc57..aa8d25c592 100644 --- a/core/src/boot.py +++ b/core/src/boot.py @@ -4,15 +4,15 @@ from trezor.pin import pin_to_int, show_pin_timeout from apps.common import storage from apps.common.request_pin import PinCancelled, request_pin from apps.common.sd_salt import SdProtectCancelled, request_sd_salt -from apps.common.storage import device +from apps.common.storage import device as storage_device if False: from typing import Optional async def bootscreen() -> None: - ui.display.orientation(storage.device.get_rotation()) - salt_auth_key = device.get_sd_salt_auth_key() + ui.display.orientation(storage_device.get_rotation()) + salt_auth_key = storage_device.get_sd_salt_auth_key() while True: try: @@ -47,8 +47,8 @@ async def bootscreen() -> None: async def lockscreen() -> None: - label = storage.device.get_label() - image = storage.device.get_homescreen() + label = storage_device.get_label() + image = storage_device.get_homescreen() if not label: label = "My Trezor" if not image: diff --git a/core/src/trezor/log.py b/core/src/trezor/log.py index d31f7d0fb9..7ebf9e5bac 100644 --- a/core/src/trezor/log.py +++ b/core/src/trezor/log.py @@ -60,8 +60,15 @@ def critical(name: str, msg: str, *args: Any) -> None: def exception(name: str, exc: BaseException) -> None: # we are using `__class__.__name__` to avoid importing ui module + # we also need to instruct mypy to ignore the missing argument + # in ui.Result exception if exc.__class__.__name__ == "Result": - _log(name, DEBUG, "ui.Result: %s", exc.value) + _log( + name, + DEBUG, + "ui.Result: %s", + exc.value, # type: ignore[attr-defined] # noqa: F821 + ) elif exc.__class__.__name__ == "Cancelled": _log(name, DEBUG, "ui.Cancelled") else: diff --git a/core/src/trezor/loop.py b/core/src/trezor/loop.py index 3fc22d3fb0..1bf13db503 100644 --- a/core/src/trezor/loop.py +++ b/core/src/trezor/loop.py @@ -375,15 +375,15 @@ class chan: self.ch = ch self.task = None # type: Optional[Task] - def handle(self, task) -> None: + def handle(self, task: Task) -> None: self.task = task self.ch._schedule_take(task) - def __init__(self): + def __init__(self) -> None: self.putters = [] # type: List[Tuple[Optional[Task], Any]] self.takers = [] # type: List[Task] - def put(self, value: Any) -> None: + def put(self, value: Any) -> Awaitable[None]: # type: ignore put = chan.Put(self, value) try: return (yield put) @@ -393,7 +393,7 @@ class chan: self.putters.remove(entry) raise - def take(self) -> None: + def take(self) -> Awaitable[Any]: # type: ignore take = chan.Take(self) try: return (yield take) @@ -409,7 +409,7 @@ class chan: else: self.putters.append((None, value)) - def _schedule_put(self, putter: Task, value: Any) -> None: + def _schedule_put(self, putter: Task, value: Any) -> bool: if self.takers: taker = self.takers.pop(0) schedule(taker, value) diff --git a/core/src/trezor/messages/Address.py b/core/src/trezor/messages/Address.py index fca64e347c..7d05714496 100644 --- a/core/src/trezor/messages/Address.py +++ b/core/src/trezor/messages/Address.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Address(p.MessageType): diff --git a/core/src/trezor/messages/ApplyFlags.py b/core/src/trezor/messages/ApplyFlags.py index cb4da674e2..376b3d61c9 100644 --- a/core/src/trezor/messages/ApplyFlags.py +++ b/core/src/trezor/messages/ApplyFlags.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ApplyFlags(p.MessageType): diff --git a/core/src/trezor/messages/ApplySettings.py b/core/src/trezor/messages/ApplySettings.py index 42a118aadf..986d105918 100644 --- a/core/src/trezor/messages/ApplySettings.py +++ b/core/src/trezor/messages/ApplySettings.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypePassphraseSourceType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypePassphraseSourceType = None # type: ignore + pass class ApplySettings(p.MessageType): diff --git a/core/src/trezor/messages/BackupDevice.py b/core/src/trezor/messages/BackupDevice.py index 6032038263..a37ab856f1 100644 --- a/core/src/trezor/messages/BackupDevice.py +++ b/core/src/trezor/messages/BackupDevice.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BackupDevice(p.MessageType): diff --git a/core/src/trezor/messages/BackupType.py b/core/src/trezor/messages/BackupType.py index d9e6f6fc4a..7b3e30a6cd 100644 --- a/core/src/trezor/messages/BackupType.py +++ b/core/src/trezor/messages/BackupType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -Bip39 = 0 -Slip39_Basic = 1 -Slip39_Advanced = 2 +if False: + from typing_extensions import Literal + +Bip39 = 0 # type: Literal[0] +Slip39_Basic = 1 # type: Literal[1] +Slip39_Advanced = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/BinanceAddress.py b/core/src/trezor/messages/BinanceAddress.py index 8b900f8b3c..da5e914d82 100644 --- a/core/src/trezor/messages/BinanceAddress.py +++ b/core/src/trezor/messages/BinanceAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceAddress(p.MessageType): diff --git a/core/src/trezor/messages/BinanceCancelMsg.py b/core/src/trezor/messages/BinanceCancelMsg.py index d9eac7e7bd..ba2ec4a912 100644 --- a/core/src/trezor/messages/BinanceCancelMsg.py +++ b/core/src/trezor/messages/BinanceCancelMsg.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceCancelMsg(p.MessageType): diff --git a/core/src/trezor/messages/BinanceCoin.py b/core/src/trezor/messages/BinanceCoin.py index e5c3f61481..3416723edf 100644 --- a/core/src/trezor/messages/BinanceCoin.py +++ b/core/src/trezor/messages/BinanceCoin.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceCoin(p.MessageType): diff --git a/core/src/trezor/messages/BinanceGetAddress.py b/core/src/trezor/messages/BinanceGetAddress.py index d011a8cd65..4559e16225 100644 --- a/core/src/trezor/messages/BinanceGetAddress.py +++ b/core/src/trezor/messages/BinanceGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/BinanceGetPublicKey.py b/core/src/trezor/messages/BinanceGetPublicKey.py index 1e561d1460..6febfe1501 100644 --- a/core/src/trezor/messages/BinanceGetPublicKey.py +++ b/core/src/trezor/messages/BinanceGetPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceGetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/BinanceInputOutput.py b/core/src/trezor/messages/BinanceInputOutput.py index bc36be1b89..4544a5fecd 100644 --- a/core/src/trezor/messages/BinanceInputOutput.py +++ b/core/src/trezor/messages/BinanceInputOutput.py @@ -6,10 +6,10 @@ from .BinanceCoin import BinanceCoin if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceInputOutput(p.MessageType): diff --git a/core/src/trezor/messages/BinanceOrderMsg.py b/core/src/trezor/messages/BinanceOrderMsg.py index e55982d5e8..0ba7522492 100644 --- a/core/src/trezor/messages/BinanceOrderMsg.py +++ b/core/src/trezor/messages/BinanceOrderMsg.py @@ -4,16 +4,13 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeBinanceOrderType = Literal[0, 1, 2, 3] EnumTypeBinanceOrderSide = Literal[0, 1, 2] EnumTypeBinanceTimeInForce = Literal[0, 1, 2, 3] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeBinanceOrderType = None # type: ignore - EnumTypeBinanceOrderSide = None # type: ignore - EnumTypeBinanceTimeInForce = None # type: ignore + pass class BinanceOrderMsg(p.MessageType): diff --git a/core/src/trezor/messages/BinanceOrderSide.py b/core/src/trezor/messages/BinanceOrderSide.py index 454fff0fe6..1105b9849e 100644 --- a/core/src/trezor/messages/BinanceOrderSide.py +++ b/core/src/trezor/messages/BinanceOrderSide.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -SIDE_UNKNOWN = 0 -BUY = 1 -SELL = 2 +if False: + from typing_extensions import Literal + +SIDE_UNKNOWN = 0 # type: Literal[0] +BUY = 1 # type: Literal[1] +SELL = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/BinanceOrderType.py b/core/src/trezor/messages/BinanceOrderType.py index 3349a5fdba..6bd753c46f 100644 --- a/core/src/trezor/messages/BinanceOrderType.py +++ b/core/src/trezor/messages/BinanceOrderType.py @@ -1,6 +1,9 @@ # Automatically generated by pb2py # fmt: off -OT_UNKNOWN = 0 -MARKET = 1 -LIMIT = 2 -OT_RESERVED = 3 +if False: + from typing_extensions import Literal + +OT_UNKNOWN = 0 # type: Literal[0] +MARKET = 1 # type: Literal[1] +LIMIT = 2 # type: Literal[2] +OT_RESERVED = 3 # type: Literal[3] diff --git a/core/src/trezor/messages/BinancePublicKey.py b/core/src/trezor/messages/BinancePublicKey.py index 7c85e586b0..6a6860844b 100644 --- a/core/src/trezor/messages/BinancePublicKey.py +++ b/core/src/trezor/messages/BinancePublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinancePublicKey(p.MessageType): diff --git a/core/src/trezor/messages/BinanceSignTx.py b/core/src/trezor/messages/BinanceSignTx.py index 2429985915..5e3bcdf0cb 100644 --- a/core/src/trezor/messages/BinanceSignTx.py +++ b/core/src/trezor/messages/BinanceSignTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceSignTx(p.MessageType): diff --git a/core/src/trezor/messages/BinanceSignedTx.py b/core/src/trezor/messages/BinanceSignedTx.py index de1a5c5a37..5e1c5cb242 100644 --- a/core/src/trezor/messages/BinanceSignedTx.py +++ b/core/src/trezor/messages/BinanceSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/BinanceTimeInForce.py b/core/src/trezor/messages/BinanceTimeInForce.py index fa6e5f4207..d3d596dd1f 100644 --- a/core/src/trezor/messages/BinanceTimeInForce.py +++ b/core/src/trezor/messages/BinanceTimeInForce.py @@ -1,6 +1,9 @@ # Automatically generated by pb2py # fmt: off -TIF_UNKNOWN = 0 -GTE = 1 -TIF_RESERVED = 2 -IOC = 3 +if False: + from typing_extensions import Literal + +TIF_UNKNOWN = 0 # type: Literal[0] +GTE = 1 # type: Literal[1] +TIF_RESERVED = 2 # type: Literal[2] +IOC = 3 # type: Literal[3] diff --git a/core/src/trezor/messages/BinanceTransferMsg.py b/core/src/trezor/messages/BinanceTransferMsg.py index f2ad7560f5..17e65a6051 100644 --- a/core/src/trezor/messages/BinanceTransferMsg.py +++ b/core/src/trezor/messages/BinanceTransferMsg.py @@ -6,10 +6,10 @@ from .BinanceInputOutput import BinanceInputOutput if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceTransferMsg(p.MessageType): diff --git a/core/src/trezor/messages/BinanceTxRequest.py b/core/src/trezor/messages/BinanceTxRequest.py index 121f9b404f..d80f12cd91 100644 --- a/core/src/trezor/messages/BinanceTxRequest.py +++ b/core/src/trezor/messages/BinanceTxRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceTxRequest(p.MessageType): diff --git a/core/src/trezor/messages/ButtonAck.py b/core/src/trezor/messages/ButtonAck.py index cd0166b6de..015b83c3ba 100644 --- a/core/src/trezor/messages/ButtonAck.py +++ b/core/src/trezor/messages/ButtonAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ButtonAck(p.MessageType): diff --git a/core/src/trezor/messages/ButtonRequest.py b/core/src/trezor/messages/ButtonRequest.py index c8985fbffb..c1dafdfa70 100644 --- a/core/src/trezor/messages/ButtonRequest.py +++ b/core/src/trezor/messages/ButtonRequest.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeButtonRequestType = None # type: ignore + pass class ButtonRequest(p.MessageType): diff --git a/core/src/trezor/messages/ButtonRequestType.py b/core/src/trezor/messages/ButtonRequestType.py index 3206fa0af0..f29e98d1e4 100644 --- a/core/src/trezor/messages/ButtonRequestType.py +++ b/core/src/trezor/messages/ButtonRequestType.py @@ -1,20 +1,23 @@ # Automatically generated by pb2py # fmt: off -Other = 1 -FeeOverThreshold = 2 -ConfirmOutput = 3 -ResetDevice = 4 -ConfirmWord = 5 -WipeDevice = 6 -ProtectCall = 7 -SignTx = 8 -FirmwareCheck = 9 -Address = 10 -PublicKey = 11 -MnemonicWordCount = 12 -MnemonicInput = 13 -PassphraseType = 14 -UnknownDerivationPath = 15 -RecoveryHomepage = 16 -Success = 17 -Warning = 18 +if False: + from typing_extensions import Literal + +Other = 1 # type: Literal[1] +FeeOverThreshold = 2 # type: Literal[2] +ConfirmOutput = 3 # type: Literal[3] +ResetDevice = 4 # type: Literal[4] +ConfirmWord = 5 # type: Literal[5] +WipeDevice = 6 # type: Literal[6] +ProtectCall = 7 # type: Literal[7] +SignTx = 8 # type: Literal[8] +FirmwareCheck = 9 # type: Literal[9] +Address = 10 # type: Literal[10] +PublicKey = 11 # type: Literal[11] +MnemonicWordCount = 12 # type: Literal[12] +MnemonicInput = 13 # type: Literal[13] +PassphraseType = 14 # type: Literal[14] +UnknownDerivationPath = 15 # type: Literal[15] +RecoveryHomepage = 16 # type: Literal[16] +Success = 17 # type: Literal[17] +Warning = 18 # type: Literal[18] diff --git a/core/src/trezor/messages/Cancel.py b/core/src/trezor/messages/Cancel.py index 28f223e39d..4ac639ccd2 100644 --- a/core/src/trezor/messages/Cancel.py +++ b/core/src/trezor/messages/Cancel.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Cancel(p.MessageType): diff --git a/core/src/trezor/messages/Capability.py b/core/src/trezor/messages/Capability.py index 7ce3f05b6a..ae1c5abb5f 100644 --- a/core/src/trezor/messages/Capability.py +++ b/core/src/trezor/messages/Capability.py @@ -2,21 +2,24 @@ # fmt: off from trezor import utils -Bitcoin = 1 +if False: + from typing_extensions import Literal + +Bitcoin = 1 # type: Literal[1] if not utils.BITCOIN_ONLY: - Bitcoin_like = 2 - Binance = 3 - Cardano = 4 -Crypto = 5 + Bitcoin_like = 2 # type: Literal[2] + Binance = 3 # type: Literal[3] + Cardano = 4 # type: Literal[4] +Crypto = 5 # type: Literal[5] if not utils.BITCOIN_ONLY: - EOS = 6 - Ethereum = 7 - Lisk = 8 - Monero = 9 - NEM = 10 - Ripple = 11 - Stellar = 12 - Tezos = 13 - U2F = 14 -Shamir = 15 -ShamirGroups = 16 + EOS = 6 # type: Literal[6] + Ethereum = 7 # type: Literal[7] + Lisk = 8 # type: Literal[8] + Monero = 9 # type: Literal[9] + NEM = 10 # type: Literal[10] + Ripple = 11 # type: Literal[11] + Stellar = 12 # type: Literal[12] + Tezos = 13 # type: Literal[13] + U2F = 14 # type: Literal[14] +Shamir = 15 # type: Literal[15] +ShamirGroups = 16 # type: Literal[16] diff --git a/core/src/trezor/messages/CardanoAddress.py b/core/src/trezor/messages/CardanoAddress.py index 7941868818..172f7a8d94 100644 --- a/core/src/trezor/messages/CardanoAddress.py +++ b/core/src/trezor/messages/CardanoAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoAddress(p.MessageType): diff --git a/core/src/trezor/messages/CardanoGetAddress.py b/core/src/trezor/messages/CardanoGetAddress.py index 0ddc7e29c3..fa608a8b3d 100644 --- a/core/src/trezor/messages/CardanoGetAddress.py +++ b/core/src/trezor/messages/CardanoGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/CardanoGetPublicKey.py b/core/src/trezor/messages/CardanoGetPublicKey.py index 377e9e2321..cb34646810 100644 --- a/core/src/trezor/messages/CardanoGetPublicKey.py +++ b/core/src/trezor/messages/CardanoGetPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoGetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/CardanoPublicKey.py b/core/src/trezor/messages/CardanoPublicKey.py index a68cdae64c..904945596a 100644 --- a/core/src/trezor/messages/CardanoPublicKey.py +++ b/core/src/trezor/messages/CardanoPublicKey.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/CardanoSignTx.py b/core/src/trezor/messages/CardanoSignTx.py index 410ad89076..ac9879e0fe 100644 --- a/core/src/trezor/messages/CardanoSignTx.py +++ b/core/src/trezor/messages/CardanoSignTx.py @@ -7,10 +7,10 @@ from .CardanoTxOutputType import CardanoTxOutputType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoSignTx(p.MessageType): diff --git a/core/src/trezor/messages/CardanoSignedTx.py b/core/src/trezor/messages/CardanoSignedTx.py index 789a5bdf74..0633eaa45a 100644 --- a/core/src/trezor/messages/CardanoSignedTx.py +++ b/core/src/trezor/messages/CardanoSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/CardanoTxAck.py b/core/src/trezor/messages/CardanoTxAck.py index d23533cdc9..0169731470 100644 --- a/core/src/trezor/messages/CardanoTxAck.py +++ b/core/src/trezor/messages/CardanoTxAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxAck(p.MessageType): diff --git a/core/src/trezor/messages/CardanoTxInputType.py b/core/src/trezor/messages/CardanoTxInputType.py index ca48ef61d3..668e612a78 100644 --- a/core/src/trezor/messages/CardanoTxInputType.py +++ b/core/src/trezor/messages/CardanoTxInputType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxInputType(p.MessageType): diff --git a/core/src/trezor/messages/CardanoTxOutputType.py b/core/src/trezor/messages/CardanoTxOutputType.py index fe9e83a134..a6285c08e3 100644 --- a/core/src/trezor/messages/CardanoTxOutputType.py +++ b/core/src/trezor/messages/CardanoTxOutputType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxOutputType(p.MessageType): diff --git a/core/src/trezor/messages/CardanoTxRequest.py b/core/src/trezor/messages/CardanoTxRequest.py index 4c58ca0b97..f47134f00f 100644 --- a/core/src/trezor/messages/CardanoTxRequest.py +++ b/core/src/trezor/messages/CardanoTxRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxRequest(p.MessageType): diff --git a/core/src/trezor/messages/ChangePin.py b/core/src/trezor/messages/ChangePin.py index ddd1b07437..1248b95054 100644 --- a/core/src/trezor/messages/ChangePin.py +++ b/core/src/trezor/messages/ChangePin.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ChangePin(p.MessageType): diff --git a/core/src/trezor/messages/CipherKeyValue.py b/core/src/trezor/messages/CipherKeyValue.py index b78004c3a0..504e3343ec 100644 --- a/core/src/trezor/messages/CipherKeyValue.py +++ b/core/src/trezor/messages/CipherKeyValue.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CipherKeyValue(p.MessageType): diff --git a/core/src/trezor/messages/CipheredKeyValue.py b/core/src/trezor/messages/CipheredKeyValue.py index d891123e47..f24f397921 100644 --- a/core/src/trezor/messages/CipheredKeyValue.py +++ b/core/src/trezor/messages/CipheredKeyValue.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CipheredKeyValue(p.MessageType): diff --git a/core/src/trezor/messages/ClearSession.py b/core/src/trezor/messages/ClearSession.py index e7a956ba54..149b001406 100644 --- a/core/src/trezor/messages/ClearSession.py +++ b/core/src/trezor/messages/ClearSession.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ClearSession(p.MessageType): diff --git a/core/src/trezor/messages/DebugLinkDecision.py b/core/src/trezor/messages/DebugLinkDecision.py index 0f7a09a943..55d2a4092e 100644 --- a/core/src/trezor/messages/DebugLinkDecision.py +++ b/core/src/trezor/messages/DebugLinkDecision.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeDebugSwipeDirection = Literal[0, 1, 2, 3] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeDebugSwipeDirection = None # type: ignore + pass class DebugLinkDecision(p.MessageType): diff --git a/core/src/trezor/messages/DebugLinkGetState.py b/core/src/trezor/messages/DebugLinkGetState.py index 1b834fe451..74403cb429 100644 --- a/core/src/trezor/messages/DebugLinkGetState.py +++ b/core/src/trezor/messages/DebugLinkGetState.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkGetState(p.MessageType): diff --git a/core/src/trezor/messages/DebugLinkState.py b/core/src/trezor/messages/DebugLinkState.py index 3bbf4f2e72..14b79c7049 100644 --- a/core/src/trezor/messages/DebugLinkState.py +++ b/core/src/trezor/messages/DebugLinkState.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkState(p.MessageType): diff --git a/core/src/trezor/messages/DebugMoneroDiagAck.py b/core/src/trezor/messages/DebugMoneroDiagAck.py index 1175db2bae..f34b701ada 100644 --- a/core/src/trezor/messages/DebugMoneroDiagAck.py +++ b/core/src/trezor/messages/DebugMoneroDiagAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugMoneroDiagAck(p.MessageType): diff --git a/core/src/trezor/messages/DebugMoneroDiagRequest.py b/core/src/trezor/messages/DebugMoneroDiagRequest.py index 7ba997d41d..b935ce03d8 100644 --- a/core/src/trezor/messages/DebugMoneroDiagRequest.py +++ b/core/src/trezor/messages/DebugMoneroDiagRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugMoneroDiagRequest(p.MessageType): diff --git a/core/src/trezor/messages/DebugSwipeDirection.py b/core/src/trezor/messages/DebugSwipeDirection.py index 23d6f9f998..b53ccc7ff2 100644 --- a/core/src/trezor/messages/DebugSwipeDirection.py +++ b/core/src/trezor/messages/DebugSwipeDirection.py @@ -1,6 +1,9 @@ # Automatically generated by pb2py # fmt: off -UP = 0 -DOWN = 1 -LEFT = 2 -RIGHT = 3 +if False: + from typing_extensions import Literal + +UP = 0 # type: Literal[0] +DOWN = 1 # type: Literal[1] +LEFT = 2 # type: Literal[2] +RIGHT = 3 # type: Literal[3] diff --git a/core/src/trezor/messages/ECDHSessionKey.py b/core/src/trezor/messages/ECDHSessionKey.py index 88a08a1549..4c97858918 100644 --- a/core/src/trezor/messages/ECDHSessionKey.py +++ b/core/src/trezor/messages/ECDHSessionKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ECDHSessionKey(p.MessageType): diff --git a/core/src/trezor/messages/Entropy.py b/core/src/trezor/messages/Entropy.py index 984b484d45..120f8ffd0e 100644 --- a/core/src/trezor/messages/Entropy.py +++ b/core/src/trezor/messages/Entropy.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Entropy(p.MessageType): diff --git a/core/src/trezor/messages/EntropyAck.py b/core/src/trezor/messages/EntropyAck.py index 3ccd6a80cb..2e783e7419 100644 --- a/core/src/trezor/messages/EntropyAck.py +++ b/core/src/trezor/messages/EntropyAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EntropyAck(p.MessageType): diff --git a/core/src/trezor/messages/EntropyRequest.py b/core/src/trezor/messages/EntropyRequest.py index 8b13ba8664..57426760d0 100644 --- a/core/src/trezor/messages/EntropyRequest.py +++ b/core/src/trezor/messages/EntropyRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EntropyRequest(p.MessageType): diff --git a/core/src/trezor/messages/EosActionBuyRam.py b/core/src/trezor/messages/EosActionBuyRam.py index 8a7a03798c..e19b112fa3 100644 --- a/core/src/trezor/messages/EosActionBuyRam.py +++ b/core/src/trezor/messages/EosActionBuyRam.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionBuyRam(p.MessageType): diff --git a/core/src/trezor/messages/EosActionBuyRamBytes.py b/core/src/trezor/messages/EosActionBuyRamBytes.py index 2ad82455e4..e330663a6f 100644 --- a/core/src/trezor/messages/EosActionBuyRamBytes.py +++ b/core/src/trezor/messages/EosActionBuyRamBytes.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionBuyRamBytes(p.MessageType): diff --git a/core/src/trezor/messages/EosActionCommon.py b/core/src/trezor/messages/EosActionCommon.py index 91051df825..58cb5ce6ef 100644 --- a/core/src/trezor/messages/EosActionCommon.py +++ b/core/src/trezor/messages/EosActionCommon.py @@ -6,10 +6,10 @@ from .EosPermissionLevel import EosPermissionLevel if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionCommon(p.MessageType): diff --git a/core/src/trezor/messages/EosActionDelegate.py b/core/src/trezor/messages/EosActionDelegate.py index cd631e51f6..c9b4d9bfcd 100644 --- a/core/src/trezor/messages/EosActionDelegate.py +++ b/core/src/trezor/messages/EosActionDelegate.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionDelegate(p.MessageType): diff --git a/core/src/trezor/messages/EosActionDeleteAuth.py b/core/src/trezor/messages/EosActionDeleteAuth.py index 89b3896e0c..790b980508 100644 --- a/core/src/trezor/messages/EosActionDeleteAuth.py +++ b/core/src/trezor/messages/EosActionDeleteAuth.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionDeleteAuth(p.MessageType): diff --git a/core/src/trezor/messages/EosActionLinkAuth.py b/core/src/trezor/messages/EosActionLinkAuth.py index 95c7b650c4..387218b0e8 100644 --- a/core/src/trezor/messages/EosActionLinkAuth.py +++ b/core/src/trezor/messages/EosActionLinkAuth.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionLinkAuth(p.MessageType): diff --git a/core/src/trezor/messages/EosActionNewAccount.py b/core/src/trezor/messages/EosActionNewAccount.py index de62fbbdc5..8d1f5304aa 100644 --- a/core/src/trezor/messages/EosActionNewAccount.py +++ b/core/src/trezor/messages/EosActionNewAccount.py @@ -6,10 +6,10 @@ from .EosAuthorization import EosAuthorization if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionNewAccount(p.MessageType): diff --git a/core/src/trezor/messages/EosActionRefund.py b/core/src/trezor/messages/EosActionRefund.py index c05a27cd4d..c9aec763cb 100644 --- a/core/src/trezor/messages/EosActionRefund.py +++ b/core/src/trezor/messages/EosActionRefund.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionRefund(p.MessageType): diff --git a/core/src/trezor/messages/EosActionSellRam.py b/core/src/trezor/messages/EosActionSellRam.py index 476ad4b813..40e5c472ee 100644 --- a/core/src/trezor/messages/EosActionSellRam.py +++ b/core/src/trezor/messages/EosActionSellRam.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionSellRam(p.MessageType): diff --git a/core/src/trezor/messages/EosActionTransfer.py b/core/src/trezor/messages/EosActionTransfer.py index afadc1c625..7bb0253c13 100644 --- a/core/src/trezor/messages/EosActionTransfer.py +++ b/core/src/trezor/messages/EosActionTransfer.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionTransfer(p.MessageType): diff --git a/core/src/trezor/messages/EosActionUndelegate.py b/core/src/trezor/messages/EosActionUndelegate.py index a42b8fdfab..4030bac140 100644 --- a/core/src/trezor/messages/EosActionUndelegate.py +++ b/core/src/trezor/messages/EosActionUndelegate.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUndelegate(p.MessageType): diff --git a/core/src/trezor/messages/EosActionUnknown.py b/core/src/trezor/messages/EosActionUnknown.py index 1a2e3ef9ce..536ad817a5 100644 --- a/core/src/trezor/messages/EosActionUnknown.py +++ b/core/src/trezor/messages/EosActionUnknown.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUnknown(p.MessageType): diff --git a/core/src/trezor/messages/EosActionUnlinkAuth.py b/core/src/trezor/messages/EosActionUnlinkAuth.py index cad2341604..7058e1ad84 100644 --- a/core/src/trezor/messages/EosActionUnlinkAuth.py +++ b/core/src/trezor/messages/EosActionUnlinkAuth.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUnlinkAuth(p.MessageType): diff --git a/core/src/trezor/messages/EosActionUpdateAuth.py b/core/src/trezor/messages/EosActionUpdateAuth.py index 0bbb7531cf..ec823fa0b0 100644 --- a/core/src/trezor/messages/EosActionUpdateAuth.py +++ b/core/src/trezor/messages/EosActionUpdateAuth.py @@ -6,10 +6,10 @@ from .EosAuthorization import EosAuthorization if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUpdateAuth(p.MessageType): diff --git a/core/src/trezor/messages/EosActionVoteProducer.py b/core/src/trezor/messages/EosActionVoteProducer.py index e7175e0dbd..54930e8bc2 100644 --- a/core/src/trezor/messages/EosActionVoteProducer.py +++ b/core/src/trezor/messages/EosActionVoteProducer.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionVoteProducer(p.MessageType): diff --git a/core/src/trezor/messages/EosAsset.py b/core/src/trezor/messages/EosAsset.py index bac7f995f6..472303b24b 100644 --- a/core/src/trezor/messages/EosAsset.py +++ b/core/src/trezor/messages/EosAsset.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAsset(p.MessageType): diff --git a/core/src/trezor/messages/EosAuthorization.py b/core/src/trezor/messages/EosAuthorization.py index e6092101ec..d41bbd7ca9 100644 --- a/core/src/trezor/messages/EosAuthorization.py +++ b/core/src/trezor/messages/EosAuthorization.py @@ -8,10 +8,10 @@ from .EosAuthorizationWait import EosAuthorizationWait if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorization(p.MessageType): diff --git a/core/src/trezor/messages/EosAuthorizationAccount.py b/core/src/trezor/messages/EosAuthorizationAccount.py index a7daffd4cf..bf40b02b5a 100644 --- a/core/src/trezor/messages/EosAuthorizationAccount.py +++ b/core/src/trezor/messages/EosAuthorizationAccount.py @@ -6,10 +6,10 @@ from .EosPermissionLevel import EosPermissionLevel if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorizationAccount(p.MessageType): diff --git a/core/src/trezor/messages/EosAuthorizationKey.py b/core/src/trezor/messages/EosAuthorizationKey.py index 435625c555..7a87eaec4c 100644 --- a/core/src/trezor/messages/EosAuthorizationKey.py +++ b/core/src/trezor/messages/EosAuthorizationKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorizationKey(p.MessageType): diff --git a/core/src/trezor/messages/EosAuthorizationWait.py b/core/src/trezor/messages/EosAuthorizationWait.py index 137c1e3ae0..1662a6b741 100644 --- a/core/src/trezor/messages/EosAuthorizationWait.py +++ b/core/src/trezor/messages/EosAuthorizationWait.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorizationWait(p.MessageType): diff --git a/core/src/trezor/messages/EosGetPublicKey.py b/core/src/trezor/messages/EosGetPublicKey.py index fba03937a8..96eb56acfc 100644 --- a/core/src/trezor/messages/EosGetPublicKey.py +++ b/core/src/trezor/messages/EosGetPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosGetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/EosPermissionLevel.py b/core/src/trezor/messages/EosPermissionLevel.py index 3a407879a2..b6ffa67644 100644 --- a/core/src/trezor/messages/EosPermissionLevel.py +++ b/core/src/trezor/messages/EosPermissionLevel.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosPermissionLevel(p.MessageType): diff --git a/core/src/trezor/messages/EosPublicKey.py b/core/src/trezor/messages/EosPublicKey.py index e50aa79754..a3aefe8c1c 100644 --- a/core/src/trezor/messages/EosPublicKey.py +++ b/core/src/trezor/messages/EosPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/EosSignTx.py b/core/src/trezor/messages/EosSignTx.py index e2027fcaa7..6404b28ff0 100644 --- a/core/src/trezor/messages/EosSignTx.py +++ b/core/src/trezor/messages/EosSignTx.py @@ -6,10 +6,10 @@ from .EosTxHeader import EosTxHeader if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosSignTx(p.MessageType): diff --git a/core/src/trezor/messages/EosSignedTx.py b/core/src/trezor/messages/EosSignedTx.py index 755fc01e9b..b98dd11b57 100644 --- a/core/src/trezor/messages/EosSignedTx.py +++ b/core/src/trezor/messages/EosSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/EosTxActionAck.py b/core/src/trezor/messages/EosTxActionAck.py index 7b7f37d1c9..1decbcd9d8 100644 --- a/core/src/trezor/messages/EosTxActionAck.py +++ b/core/src/trezor/messages/EosTxActionAck.py @@ -20,10 +20,10 @@ from .EosActionVoteProducer import EosActionVoteProducer if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosTxActionAck(p.MessageType): diff --git a/core/src/trezor/messages/EosTxActionRequest.py b/core/src/trezor/messages/EosTxActionRequest.py index b3a67e49a9..2228ffb1d1 100644 --- a/core/src/trezor/messages/EosTxActionRequest.py +++ b/core/src/trezor/messages/EosTxActionRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosTxActionRequest(p.MessageType): diff --git a/core/src/trezor/messages/EosTxHeader.py b/core/src/trezor/messages/EosTxHeader.py index 8c253fd4a1..0dbfd3dc79 100644 --- a/core/src/trezor/messages/EosTxHeader.py +++ b/core/src/trezor/messages/EosTxHeader.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosTxHeader(p.MessageType): diff --git a/core/src/trezor/messages/EthereumAddress.py b/core/src/trezor/messages/EthereumAddress.py index 3c2d1ad51f..50339e5db5 100644 --- a/core/src/trezor/messages/EthereumAddress.py +++ b/core/src/trezor/messages/EthereumAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumAddress(p.MessageType): diff --git a/core/src/trezor/messages/EthereumGetAddress.py b/core/src/trezor/messages/EthereumGetAddress.py index d4f0ac4925..1d26bdaecc 100644 --- a/core/src/trezor/messages/EthereumGetAddress.py +++ b/core/src/trezor/messages/EthereumGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/EthereumGetPublicKey.py b/core/src/trezor/messages/EthereumGetPublicKey.py index cb0481de5d..b3d1ecb81a 100644 --- a/core/src/trezor/messages/EthereumGetPublicKey.py +++ b/core/src/trezor/messages/EthereumGetPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumGetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/EthereumMessageSignature.py b/core/src/trezor/messages/EthereumMessageSignature.py index 29dab290d0..27b70a7824 100644 --- a/core/src/trezor/messages/EthereumMessageSignature.py +++ b/core/src/trezor/messages/EthereumMessageSignature.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumMessageSignature(p.MessageType): diff --git a/core/src/trezor/messages/EthereumPublicKey.py b/core/src/trezor/messages/EthereumPublicKey.py index e700dc14d5..2b62766426 100644 --- a/core/src/trezor/messages/EthereumPublicKey.py +++ b/core/src/trezor/messages/EthereumPublicKey.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/EthereumSignMessage.py b/core/src/trezor/messages/EthereumSignMessage.py index e615995170..131461d488 100644 --- a/core/src/trezor/messages/EthereumSignMessage.py +++ b/core/src/trezor/messages/EthereumSignMessage.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumSignMessage(p.MessageType): diff --git a/core/src/trezor/messages/EthereumSignTx.py b/core/src/trezor/messages/EthereumSignTx.py index 15140ef680..d82af076f0 100644 --- a/core/src/trezor/messages/EthereumSignTx.py +++ b/core/src/trezor/messages/EthereumSignTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumSignTx(p.MessageType): diff --git a/core/src/trezor/messages/EthereumTxAck.py b/core/src/trezor/messages/EthereumTxAck.py index 5cec103b24..951a82ce8e 100644 --- a/core/src/trezor/messages/EthereumTxAck.py +++ b/core/src/trezor/messages/EthereumTxAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumTxAck(p.MessageType): diff --git a/core/src/trezor/messages/EthereumTxRequest.py b/core/src/trezor/messages/EthereumTxRequest.py index fa807c106e..281259f265 100644 --- a/core/src/trezor/messages/EthereumTxRequest.py +++ b/core/src/trezor/messages/EthereumTxRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumTxRequest(p.MessageType): diff --git a/core/src/trezor/messages/EthereumVerifyMessage.py b/core/src/trezor/messages/EthereumVerifyMessage.py index c0dc9d5e38..3465217ba2 100644 --- a/core/src/trezor/messages/EthereumVerifyMessage.py +++ b/core/src/trezor/messages/EthereumVerifyMessage.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumVerifyMessage(p.MessageType): diff --git a/core/src/trezor/messages/Failure.py b/core/src/trezor/messages/Failure.py index 51a0b7b3b7..eeec1d7c75 100644 --- a/core/src/trezor/messages/Failure.py +++ b/core/src/trezor/messages/Failure.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeFailureType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 99] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeFailureType = None # type: ignore + pass class Failure(p.MessageType): diff --git a/core/src/trezor/messages/FailureType.py b/core/src/trezor/messages/FailureType.py index 6f5cffe184..1e5c8b6e74 100644 --- a/core/src/trezor/messages/FailureType.py +++ b/core/src/trezor/messages/FailureType.py @@ -1,15 +1,18 @@ # Automatically generated by pb2py # fmt: off -UnexpectedMessage = 1 -ButtonExpected = 2 -DataError = 3 -ActionCancelled = 4 -PinExpected = 5 -PinCancelled = 6 -PinInvalid = 7 -InvalidSignature = 8 -ProcessError = 9 -NotEnoughFunds = 10 -NotInitialized = 11 -PinMismatch = 12 -FirmwareError = 99 +if False: + from typing_extensions import Literal + +UnexpectedMessage = 1 # type: Literal[1] +ButtonExpected = 2 # type: Literal[2] +DataError = 3 # type: Literal[3] +ActionCancelled = 4 # type: Literal[4] +PinExpected = 5 # type: Literal[5] +PinCancelled = 6 # type: Literal[6] +PinInvalid = 7 # type: Literal[7] +InvalidSignature = 8 # type: Literal[8] +ProcessError = 9 # type: Literal[9] +NotEnoughFunds = 10 # type: Literal[10] +NotInitialized = 11 # type: Literal[11] +PinMismatch = 12 # type: Literal[12] +FirmwareError = 99 # type: Literal[99] diff --git a/core/src/trezor/messages/Features.py b/core/src/trezor/messages/Features.py index 191b5c69c5..ed38304d2d 100644 --- a/core/src/trezor/messages/Features.py +++ b/core/src/trezor/messages/Features.py @@ -4,14 +4,12 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] EnumTypeBackupType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeCapability = None # type: ignore - EnumTypeBackupType = None # type: ignore + pass class Features(p.MessageType): diff --git a/core/src/trezor/messages/GetAddress.py b/core/src/trezor/messages/GetAddress.py index 191aa8756d..e8cea9fbf8 100644 --- a/core/src/trezor/messages/GetAddress.py +++ b/core/src/trezor/messages/GetAddress.py @@ -6,12 +6,11 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class GetAddress(p.MessageType): diff --git a/core/src/trezor/messages/GetECDHSessionKey.py b/core/src/trezor/messages/GetECDHSessionKey.py index 3a2609bbae..c8f93c2851 100644 --- a/core/src/trezor/messages/GetECDHSessionKey.py +++ b/core/src/trezor/messages/GetECDHSessionKey.py @@ -6,10 +6,10 @@ from .IdentityType import IdentityType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class GetECDHSessionKey(p.MessageType): diff --git a/core/src/trezor/messages/GetEntropy.py b/core/src/trezor/messages/GetEntropy.py index 74292be148..7aa89a94aa 100644 --- a/core/src/trezor/messages/GetEntropy.py +++ b/core/src/trezor/messages/GetEntropy.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class GetEntropy(p.MessageType): diff --git a/core/src/trezor/messages/GetFeatures.py b/core/src/trezor/messages/GetFeatures.py index d66bf6efa5..f8e66e209b 100644 --- a/core/src/trezor/messages/GetFeatures.py +++ b/core/src/trezor/messages/GetFeatures.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class GetFeatures(p.MessageType): diff --git a/core/src/trezor/messages/GetPublicKey.py b/core/src/trezor/messages/GetPublicKey.py index 725bceb138..e94d445afc 100644 --- a/core/src/trezor/messages/GetPublicKey.py +++ b/core/src/trezor/messages/GetPublicKey.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class GetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/HDNodePathType.py b/core/src/trezor/messages/HDNodePathType.py index b81b08886b..fd892111b6 100644 --- a/core/src/trezor/messages/HDNodePathType.py +++ b/core/src/trezor/messages/HDNodePathType.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class HDNodePathType(p.MessageType): diff --git a/core/src/trezor/messages/HDNodeType.py b/core/src/trezor/messages/HDNodeType.py index 434d54db84..abbace9873 100644 --- a/core/src/trezor/messages/HDNodeType.py +++ b/core/src/trezor/messages/HDNodeType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class HDNodeType(p.MessageType): diff --git a/core/src/trezor/messages/IdentityType.py b/core/src/trezor/messages/IdentityType.py index 475e17ff60..9f8ef01f62 100644 --- a/core/src/trezor/messages/IdentityType.py +++ b/core/src/trezor/messages/IdentityType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class IdentityType(p.MessageType): diff --git a/core/src/trezor/messages/Initialize.py b/core/src/trezor/messages/Initialize.py index b5bb5dae23..3e4176999c 100644 --- a/core/src/trezor/messages/Initialize.py +++ b/core/src/trezor/messages/Initialize.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Initialize(p.MessageType): diff --git a/core/src/trezor/messages/InputScriptType.py b/core/src/trezor/messages/InputScriptType.py index 09b8332cbe..fc2223e251 100644 --- a/core/src/trezor/messages/InputScriptType.py +++ b/core/src/trezor/messages/InputScriptType.py @@ -1,7 +1,10 @@ # Automatically generated by pb2py # fmt: off -SPENDADDRESS = 0 -SPENDMULTISIG = 1 -EXTERNAL = 2 -SPENDWITNESS = 3 -SPENDP2SHWITNESS = 4 +if False: + from typing_extensions import Literal + +SPENDADDRESS = 0 # type: Literal[0] +SPENDMULTISIG = 1 # type: Literal[1] +EXTERNAL = 2 # type: Literal[2] +SPENDWITNESS = 3 # type: Literal[3] +SPENDP2SHWITNESS = 4 # type: Literal[4] diff --git a/core/src/trezor/messages/LiskAddress.py b/core/src/trezor/messages/LiskAddress.py index 2ebb8a9dc4..e3199fc379 100644 --- a/core/src/trezor/messages/LiskAddress.py +++ b/core/src/trezor/messages/LiskAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskAddress(p.MessageType): diff --git a/core/src/trezor/messages/LiskDelegateType.py b/core/src/trezor/messages/LiskDelegateType.py index 7804d7a2a0..bf611aabc5 100644 --- a/core/src/trezor/messages/LiskDelegateType.py +++ b/core/src/trezor/messages/LiskDelegateType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskDelegateType(p.MessageType): diff --git a/core/src/trezor/messages/LiskGetAddress.py b/core/src/trezor/messages/LiskGetAddress.py index 55b69afe79..ad77a4833f 100644 --- a/core/src/trezor/messages/LiskGetAddress.py +++ b/core/src/trezor/messages/LiskGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/LiskGetPublicKey.py b/core/src/trezor/messages/LiskGetPublicKey.py index a742a12c51..4785d6691c 100644 --- a/core/src/trezor/messages/LiskGetPublicKey.py +++ b/core/src/trezor/messages/LiskGetPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskGetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/LiskMessageSignature.py b/core/src/trezor/messages/LiskMessageSignature.py index 9178fb1da0..21a7465d50 100644 --- a/core/src/trezor/messages/LiskMessageSignature.py +++ b/core/src/trezor/messages/LiskMessageSignature.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskMessageSignature(p.MessageType): diff --git a/core/src/trezor/messages/LiskMultisignatureType.py b/core/src/trezor/messages/LiskMultisignatureType.py index 55df7053c8..781a8a1d89 100644 --- a/core/src/trezor/messages/LiskMultisignatureType.py +++ b/core/src/trezor/messages/LiskMultisignatureType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskMultisignatureType(p.MessageType): diff --git a/core/src/trezor/messages/LiskPublicKey.py b/core/src/trezor/messages/LiskPublicKey.py index 7192e92e0d..c4fc70d74d 100644 --- a/core/src/trezor/messages/LiskPublicKey.py +++ b/core/src/trezor/messages/LiskPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/LiskSignMessage.py b/core/src/trezor/messages/LiskSignMessage.py index e0d0728d85..8b76e393a5 100644 --- a/core/src/trezor/messages/LiskSignMessage.py +++ b/core/src/trezor/messages/LiskSignMessage.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignMessage(p.MessageType): diff --git a/core/src/trezor/messages/LiskSignTx.py b/core/src/trezor/messages/LiskSignTx.py index afd35e0a3f..27c6416788 100644 --- a/core/src/trezor/messages/LiskSignTx.py +++ b/core/src/trezor/messages/LiskSignTx.py @@ -6,10 +6,10 @@ from .LiskTransactionCommon import LiskTransactionCommon if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignTx(p.MessageType): diff --git a/core/src/trezor/messages/LiskSignatureType.py b/core/src/trezor/messages/LiskSignatureType.py index 3bb7bd4113..af8eeddcd8 100644 --- a/core/src/trezor/messages/LiskSignatureType.py +++ b/core/src/trezor/messages/LiskSignatureType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignatureType(p.MessageType): diff --git a/core/src/trezor/messages/LiskSignedTx.py b/core/src/trezor/messages/LiskSignedTx.py index 2155b90004..925a438a06 100644 --- a/core/src/trezor/messages/LiskSignedTx.py +++ b/core/src/trezor/messages/LiskSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/LiskTransactionAsset.py b/core/src/trezor/messages/LiskTransactionAsset.py index 16bf74338e..c1f2dec90b 100644 --- a/core/src/trezor/messages/LiskTransactionAsset.py +++ b/core/src/trezor/messages/LiskTransactionAsset.py @@ -8,10 +8,10 @@ from .LiskSignatureType import LiskSignatureType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskTransactionAsset(p.MessageType): diff --git a/core/src/trezor/messages/LiskTransactionCommon.py b/core/src/trezor/messages/LiskTransactionCommon.py index c5ce85f79e..38391cfe48 100644 --- a/core/src/trezor/messages/LiskTransactionCommon.py +++ b/core/src/trezor/messages/LiskTransactionCommon.py @@ -6,12 +6,11 @@ from .LiskTransactionAsset import LiskTransactionAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeLiskTransactionType = Literal[0, 1, 2, 3, 4, 5, 6, 7] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeLiskTransactionType = None # type: ignore + pass class LiskTransactionCommon(p.MessageType): diff --git a/core/src/trezor/messages/LiskTransactionType.py b/core/src/trezor/messages/LiskTransactionType.py index 04847eed76..79069c6a94 100644 --- a/core/src/trezor/messages/LiskTransactionType.py +++ b/core/src/trezor/messages/LiskTransactionType.py @@ -1,10 +1,13 @@ # Automatically generated by pb2py # fmt: off -Transfer = 0 -RegisterSecondPassphrase = 1 -RegisterDelegate = 2 -CastVotes = 3 -RegisterMultisignatureAccount = 4 -CreateDapp = 5 -TransferIntoDapp = 6 -TransferOutOfDapp = 7 +if False: + from typing_extensions import Literal + +Transfer = 0 # type: Literal[0] +RegisterSecondPassphrase = 1 # type: Literal[1] +RegisterDelegate = 2 # type: Literal[2] +CastVotes = 3 # type: Literal[3] +RegisterMultisignatureAccount = 4 # type: Literal[4] +CreateDapp = 5 # type: Literal[5] +TransferIntoDapp = 6 # type: Literal[6] +TransferOutOfDapp = 7 # type: Literal[7] diff --git a/core/src/trezor/messages/LiskVerifyMessage.py b/core/src/trezor/messages/LiskVerifyMessage.py index f8eebbb86e..50b4f160c1 100644 --- a/core/src/trezor/messages/LiskVerifyMessage.py +++ b/core/src/trezor/messages/LiskVerifyMessage.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskVerifyMessage(p.MessageType): diff --git a/core/src/trezor/messages/LoadDevice.py b/core/src/trezor/messages/LoadDevice.py index 767e326bcd..56029e7f86 100644 --- a/core/src/trezor/messages/LoadDevice.py +++ b/core/src/trezor/messages/LoadDevice.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LoadDevice(p.MessageType): diff --git a/core/src/trezor/messages/MessageSignature.py b/core/src/trezor/messages/MessageSignature.py index e6682a4871..2e8d4316da 100644 --- a/core/src/trezor/messages/MessageSignature.py +++ b/core/src/trezor/messages/MessageSignature.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MessageSignature(p.MessageType): diff --git a/core/src/trezor/messages/MessageType.py b/core/src/trezor/messages/MessageType.py index 9c7223d7c4..5215fb4457 100644 --- a/core/src/trezor/messages/MessageType.py +++ b/core/src/trezor/messages/MessageType.py @@ -2,186 +2,189 @@ # fmt: off from trezor import utils -Initialize = 0 -Ping = 1 -Success = 2 -Failure = 3 -ChangePin = 4 -WipeDevice = 5 -GetEntropy = 9 -Entropy = 10 -LoadDevice = 13 -ResetDevice = 14 -Features = 17 -PinMatrixRequest = 18 -PinMatrixAck = 19 -Cancel = 20 -ClearSession = 24 -ApplySettings = 25 -ButtonRequest = 26 -ButtonAck = 27 -ApplyFlags = 28 -BackupDevice = 34 -EntropyRequest = 35 -EntropyAck = 36 -PassphraseRequest = 41 -PassphraseAck = 42 -PassphraseStateRequest = 77 -PassphraseStateAck = 78 -RecoveryDevice = 45 -WordRequest = 46 -WordAck = 47 -GetFeatures = 55 -SetU2FCounter = 63 -SdProtect = 79 -FirmwareErase = 6 -FirmwareUpload = 7 -FirmwareRequest = 8 -SelfTest = 32 -GetPublicKey = 11 -PublicKey = 12 -SignTx = 15 -TxRequest = 21 -TxAck = 22 -GetAddress = 29 -Address = 30 -SignMessage = 38 -VerifyMessage = 39 -MessageSignature = 40 -CipherKeyValue = 23 -CipheredKeyValue = 48 -SignIdentity = 53 -SignedIdentity = 54 -GetECDHSessionKey = 61 -ECDHSessionKey = 62 -CosiCommit = 71 -CosiCommitment = 72 -CosiSign = 73 -CosiSignature = 74 -DebugLinkDecision = 100 -DebugLinkGetState = 101 -DebugLinkState = 102 -DebugLinkStop = 103 -DebugLinkLog = 104 -DebugLinkMemoryRead = 110 -DebugLinkMemory = 111 -DebugLinkMemoryWrite = 112 -DebugLinkFlashErase = 113 +if False: + from typing_extensions import Literal + +Initialize = 0 # type: Literal[0] +Ping = 1 # type: Literal[1] +Success = 2 # type: Literal[2] +Failure = 3 # type: Literal[3] +ChangePin = 4 # type: Literal[4] +WipeDevice = 5 # type: Literal[5] +GetEntropy = 9 # type: Literal[9] +Entropy = 10 # type: Literal[10] +LoadDevice = 13 # type: Literal[13] +ResetDevice = 14 # type: Literal[14] +Features = 17 # type: Literal[17] +PinMatrixRequest = 18 # type: Literal[18] +PinMatrixAck = 19 # type: Literal[19] +Cancel = 20 # type: Literal[20] +ClearSession = 24 # type: Literal[24] +ApplySettings = 25 # type: Literal[25] +ButtonRequest = 26 # type: Literal[26] +ButtonAck = 27 # type: Literal[27] +ApplyFlags = 28 # type: Literal[28] +BackupDevice = 34 # type: Literal[34] +EntropyRequest = 35 # type: Literal[35] +EntropyAck = 36 # type: Literal[36] +PassphraseRequest = 41 # type: Literal[41] +PassphraseAck = 42 # type: Literal[42] +PassphraseStateRequest = 77 # type: Literal[77] +PassphraseStateAck = 78 # type: Literal[78] +RecoveryDevice = 45 # type: Literal[45] +WordRequest = 46 # type: Literal[46] +WordAck = 47 # type: Literal[47] +GetFeatures = 55 # type: Literal[55] +SetU2FCounter = 63 # type: Literal[63] +SdProtect = 79 # type: Literal[79] +FirmwareErase = 6 # type: Literal[6] +FirmwareUpload = 7 # type: Literal[7] +FirmwareRequest = 8 # type: Literal[8] +SelfTest = 32 # type: Literal[32] +GetPublicKey = 11 # type: Literal[11] +PublicKey = 12 # type: Literal[12] +SignTx = 15 # type: Literal[15] +TxRequest = 21 # type: Literal[21] +TxAck = 22 # type: Literal[22] +GetAddress = 29 # type: Literal[29] +Address = 30 # type: Literal[30] +SignMessage = 38 # type: Literal[38] +VerifyMessage = 39 # type: Literal[39] +MessageSignature = 40 # type: Literal[40] +CipherKeyValue = 23 # type: Literal[23] +CipheredKeyValue = 48 # type: Literal[48] +SignIdentity = 53 # type: Literal[53] +SignedIdentity = 54 # type: Literal[54] +GetECDHSessionKey = 61 # type: Literal[61] +ECDHSessionKey = 62 # type: Literal[62] +CosiCommit = 71 # type: Literal[71] +CosiCommitment = 72 # type: Literal[72] +CosiSign = 73 # type: Literal[73] +CosiSignature = 74 # type: Literal[74] +DebugLinkDecision = 100 # type: Literal[100] +DebugLinkGetState = 101 # type: Literal[101] +DebugLinkState = 102 # type: Literal[102] +DebugLinkStop = 103 # type: Literal[103] +DebugLinkLog = 104 # type: Literal[104] +DebugLinkMemoryRead = 110 # type: Literal[110] +DebugLinkMemory = 111 # type: Literal[111] +DebugLinkMemoryWrite = 112 # type: Literal[112] +DebugLinkFlashErase = 113 # type: Literal[113] if not utils.BITCOIN_ONLY: - EthereumGetPublicKey = 450 - EthereumPublicKey = 451 - EthereumGetAddress = 56 - EthereumAddress = 57 - EthereumSignTx = 58 - EthereumTxRequest = 59 - EthereumTxAck = 60 - EthereumSignMessage = 64 - EthereumVerifyMessage = 65 - EthereumMessageSignature = 66 - NEMGetAddress = 67 - NEMAddress = 68 - NEMSignTx = 69 - NEMSignedTx = 70 - NEMDecryptMessage = 75 - NEMDecryptedMessage = 76 - LiskGetAddress = 114 - LiskAddress = 115 - LiskSignTx = 116 - LiskSignedTx = 117 - LiskSignMessage = 118 - LiskMessageSignature = 119 - LiskVerifyMessage = 120 - LiskGetPublicKey = 121 - LiskPublicKey = 122 - TezosGetAddress = 150 - TezosAddress = 151 - TezosSignTx = 152 - TezosSignedTx = 153 - TezosGetPublicKey = 154 - TezosPublicKey = 155 - StellarSignTx = 202 - StellarTxOpRequest = 203 - StellarGetAddress = 207 - StellarAddress = 208 - StellarCreateAccountOp = 210 - StellarPaymentOp = 211 - StellarPathPaymentOp = 212 - StellarManageOfferOp = 213 - StellarCreatePassiveOfferOp = 214 - StellarSetOptionsOp = 215 - StellarChangeTrustOp = 216 - StellarAllowTrustOp = 217 - StellarAccountMergeOp = 218 - StellarManageDataOp = 220 - StellarBumpSequenceOp = 221 - StellarSignedTx = 230 - CardanoSignTx = 303 - CardanoTxRequest = 304 - CardanoGetPublicKey = 305 - CardanoPublicKey = 306 - CardanoGetAddress = 307 - CardanoAddress = 308 - CardanoTxAck = 309 - CardanoSignedTx = 310 - RippleGetAddress = 400 - RippleAddress = 401 - RippleSignTx = 402 - RippleSignedTx = 403 - MoneroTransactionInitRequest = 501 - MoneroTransactionInitAck = 502 - MoneroTransactionSetInputRequest = 503 - MoneroTransactionSetInputAck = 504 - MoneroTransactionInputsPermutationRequest = 505 - MoneroTransactionInputsPermutationAck = 506 - MoneroTransactionInputViniRequest = 507 - MoneroTransactionInputViniAck = 508 - MoneroTransactionAllInputsSetRequest = 509 - MoneroTransactionAllInputsSetAck = 510 - MoneroTransactionSetOutputRequest = 511 - MoneroTransactionSetOutputAck = 512 - MoneroTransactionAllOutSetRequest = 513 - MoneroTransactionAllOutSetAck = 514 - MoneroTransactionSignInputRequest = 515 - MoneroTransactionSignInputAck = 516 - MoneroTransactionFinalRequest = 517 - MoneroTransactionFinalAck = 518 - MoneroKeyImageExportInitRequest = 530 - MoneroKeyImageExportInitAck = 531 - MoneroKeyImageSyncStepRequest = 532 - MoneroKeyImageSyncStepAck = 533 - MoneroKeyImageSyncFinalRequest = 534 - MoneroKeyImageSyncFinalAck = 535 - MoneroGetAddress = 540 - MoneroAddress = 541 - MoneroGetWatchKey = 542 - MoneroWatchKey = 543 - DebugMoneroDiagRequest = 546 - DebugMoneroDiagAck = 547 - MoneroGetTxKeyRequest = 550 - MoneroGetTxKeyAck = 551 - MoneroLiveRefreshStartRequest = 552 - MoneroLiveRefreshStartAck = 553 - MoneroLiveRefreshStepRequest = 554 - MoneroLiveRefreshStepAck = 555 - MoneroLiveRefreshFinalRequest = 556 - MoneroLiveRefreshFinalAck = 557 - EosGetPublicKey = 600 - EosPublicKey = 601 - EosSignTx = 602 - EosTxActionRequest = 603 - EosTxActionAck = 604 - EosSignedTx = 605 - BinanceGetAddress = 700 - BinanceAddress = 701 - BinanceGetPublicKey = 702 - BinancePublicKey = 703 - BinanceSignTx = 704 - BinanceTxRequest = 705 - BinanceTransferMsg = 706 - BinanceOrderMsg = 707 - BinanceCancelMsg = 708 - BinanceSignedTx = 709 - WebAuthnListResidentCredentials = 800 - WebAuthnCredentials = 801 - WebAuthnAddResidentCredential = 802 - WebAuthnRemoveResidentCredential = 803 + EthereumGetPublicKey = 450 # type: Literal[450] + EthereumPublicKey = 451 # type: Literal[451] + EthereumGetAddress = 56 # type: Literal[56] + EthereumAddress = 57 # type: Literal[57] + EthereumSignTx = 58 # type: Literal[58] + EthereumTxRequest = 59 # type: Literal[59] + EthereumTxAck = 60 # type: Literal[60] + EthereumSignMessage = 64 # type: Literal[64] + EthereumVerifyMessage = 65 # type: Literal[65] + EthereumMessageSignature = 66 # type: Literal[66] + NEMGetAddress = 67 # type: Literal[67] + NEMAddress = 68 # type: Literal[68] + NEMSignTx = 69 # type: Literal[69] + NEMSignedTx = 70 # type: Literal[70] + NEMDecryptMessage = 75 # type: Literal[75] + NEMDecryptedMessage = 76 # type: Literal[76] + LiskGetAddress = 114 # type: Literal[114] + LiskAddress = 115 # type: Literal[115] + LiskSignTx = 116 # type: Literal[116] + LiskSignedTx = 117 # type: Literal[117] + LiskSignMessage = 118 # type: Literal[118] + LiskMessageSignature = 119 # type: Literal[119] + LiskVerifyMessage = 120 # type: Literal[120] + LiskGetPublicKey = 121 # type: Literal[121] + LiskPublicKey = 122 # type: Literal[122] + TezosGetAddress = 150 # type: Literal[150] + TezosAddress = 151 # type: Literal[151] + TezosSignTx = 152 # type: Literal[152] + TezosSignedTx = 153 # type: Literal[153] + TezosGetPublicKey = 154 # type: Literal[154] + TezosPublicKey = 155 # type: Literal[155] + StellarSignTx = 202 # type: Literal[202] + StellarTxOpRequest = 203 # type: Literal[203] + StellarGetAddress = 207 # type: Literal[207] + StellarAddress = 208 # type: Literal[208] + StellarCreateAccountOp = 210 # type: Literal[210] + StellarPaymentOp = 211 # type: Literal[211] + StellarPathPaymentOp = 212 # type: Literal[212] + StellarManageOfferOp = 213 # type: Literal[213] + StellarCreatePassiveOfferOp = 214 # type: Literal[214] + StellarSetOptionsOp = 215 # type: Literal[215] + StellarChangeTrustOp = 216 # type: Literal[216] + StellarAllowTrustOp = 217 # type: Literal[217] + StellarAccountMergeOp = 218 # type: Literal[218] + StellarManageDataOp = 220 # type: Literal[220] + StellarBumpSequenceOp = 221 # type: Literal[221] + StellarSignedTx = 230 # type: Literal[230] + CardanoSignTx = 303 # type: Literal[303] + CardanoTxRequest = 304 # type: Literal[304] + CardanoGetPublicKey = 305 # type: Literal[305] + CardanoPublicKey = 306 # type: Literal[306] + CardanoGetAddress = 307 # type: Literal[307] + CardanoAddress = 308 # type: Literal[308] + CardanoTxAck = 309 # type: Literal[309] + CardanoSignedTx = 310 # type: Literal[310] + RippleGetAddress = 400 # type: Literal[400] + RippleAddress = 401 # type: Literal[401] + RippleSignTx = 402 # type: Literal[402] + RippleSignedTx = 403 # type: Literal[403] + MoneroTransactionInitRequest = 501 # type: Literal[501] + MoneroTransactionInitAck = 502 # type: Literal[502] + MoneroTransactionSetInputRequest = 503 # type: Literal[503] + MoneroTransactionSetInputAck = 504 # type: Literal[504] + MoneroTransactionInputsPermutationRequest = 505 # type: Literal[505] + MoneroTransactionInputsPermutationAck = 506 # type: Literal[506] + MoneroTransactionInputViniRequest = 507 # type: Literal[507] + MoneroTransactionInputViniAck = 508 # type: Literal[508] + MoneroTransactionAllInputsSetRequest = 509 # type: Literal[509] + MoneroTransactionAllInputsSetAck = 510 # type: Literal[510] + MoneroTransactionSetOutputRequest = 511 # type: Literal[511] + MoneroTransactionSetOutputAck = 512 # type: Literal[512] + MoneroTransactionAllOutSetRequest = 513 # type: Literal[513] + MoneroTransactionAllOutSetAck = 514 # type: Literal[514] + MoneroTransactionSignInputRequest = 515 # type: Literal[515] + MoneroTransactionSignInputAck = 516 # type: Literal[516] + MoneroTransactionFinalRequest = 517 # type: Literal[517] + MoneroTransactionFinalAck = 518 # type: Literal[518] + MoneroKeyImageExportInitRequest = 530 # type: Literal[530] + MoneroKeyImageExportInitAck = 531 # type: Literal[531] + MoneroKeyImageSyncStepRequest = 532 # type: Literal[532] + MoneroKeyImageSyncStepAck = 533 # type: Literal[533] + MoneroKeyImageSyncFinalRequest = 534 # type: Literal[534] + MoneroKeyImageSyncFinalAck = 535 # type: Literal[535] + MoneroGetAddress = 540 # type: Literal[540] + MoneroAddress = 541 # type: Literal[541] + MoneroGetWatchKey = 542 # type: Literal[542] + MoneroWatchKey = 543 # type: Literal[543] + DebugMoneroDiagRequest = 546 # type: Literal[546] + DebugMoneroDiagAck = 547 # type: Literal[547] + MoneroGetTxKeyRequest = 550 # type: Literal[550] + MoneroGetTxKeyAck = 551 # type: Literal[551] + MoneroLiveRefreshStartRequest = 552 # type: Literal[552] + MoneroLiveRefreshStartAck = 553 # type: Literal[553] + MoneroLiveRefreshStepRequest = 554 # type: Literal[554] + MoneroLiveRefreshStepAck = 555 # type: Literal[555] + MoneroLiveRefreshFinalRequest = 556 # type: Literal[556] + MoneroLiveRefreshFinalAck = 557 # type: Literal[557] + EosGetPublicKey = 600 # type: Literal[600] + EosPublicKey = 601 # type: Literal[601] + EosSignTx = 602 # type: Literal[602] + EosTxActionRequest = 603 # type: Literal[603] + EosTxActionAck = 604 # type: Literal[604] + EosSignedTx = 605 # type: Literal[605] + BinanceGetAddress = 700 # type: Literal[700] + BinanceAddress = 701 # type: Literal[701] + BinanceGetPublicKey = 702 # type: Literal[702] + BinancePublicKey = 703 # type: Literal[703] + BinanceSignTx = 704 # type: Literal[704] + BinanceTxRequest = 705 # type: Literal[705] + BinanceTransferMsg = 706 # type: Literal[706] + BinanceOrderMsg = 707 # type: Literal[707] + BinanceCancelMsg = 708 # type: Literal[708] + BinanceSignedTx = 709 # type: Literal[709] + WebAuthnListResidentCredentials = 800 # type: Literal[800] + WebAuthnCredentials = 801 # type: Literal[801] + WebAuthnAddResidentCredential = 802 # type: Literal[802] + WebAuthnRemoveResidentCredential = 803 # type: Literal[803] diff --git a/core/src/trezor/messages/MoneroAccountPublicAddress.py b/core/src/trezor/messages/MoneroAccountPublicAddress.py index 59b6d6345e..039c5fca51 100644 --- a/core/src/trezor/messages/MoneroAccountPublicAddress.py +++ b/core/src/trezor/messages/MoneroAccountPublicAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroAccountPublicAddress(p.MessageType): diff --git a/core/src/trezor/messages/MoneroAddress.py b/core/src/trezor/messages/MoneroAddress.py index 27c720bbc9..6e88dd3e29 100644 --- a/core/src/trezor/messages/MoneroAddress.py +++ b/core/src/trezor/messages/MoneroAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroAddress(p.MessageType): diff --git a/core/src/trezor/messages/MoneroExportedKeyImage.py b/core/src/trezor/messages/MoneroExportedKeyImage.py index 81c29cbc84..f0d9225bc1 100644 --- a/core/src/trezor/messages/MoneroExportedKeyImage.py +++ b/core/src/trezor/messages/MoneroExportedKeyImage.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroExportedKeyImage(p.MessageType): diff --git a/core/src/trezor/messages/MoneroGetAddress.py b/core/src/trezor/messages/MoneroGetAddress.py index 1f310a2f1c..4c8fb2ea9c 100644 --- a/core/src/trezor/messages/MoneroGetAddress.py +++ b/core/src/trezor/messages/MoneroGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/MoneroGetTxKeyAck.py b/core/src/trezor/messages/MoneroGetTxKeyAck.py index 9e646815ff..c835014a6b 100644 --- a/core/src/trezor/messages/MoneroGetTxKeyAck.py +++ b/core/src/trezor/messages/MoneroGetTxKeyAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetTxKeyAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroGetTxKeyRequest.py b/core/src/trezor/messages/MoneroGetTxKeyRequest.py index 5e9777b19c..7688e6b85d 100644 --- a/core/src/trezor/messages/MoneroGetTxKeyRequest.py +++ b/core/src/trezor/messages/MoneroGetTxKeyRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetTxKeyRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroGetWatchKey.py b/core/src/trezor/messages/MoneroGetWatchKey.py index 17bea95d75..1a8184d5f5 100644 --- a/core/src/trezor/messages/MoneroGetWatchKey.py +++ b/core/src/trezor/messages/MoneroGetWatchKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetWatchKey(p.MessageType): diff --git a/core/src/trezor/messages/MoneroKeyImageExportInitAck.py b/core/src/trezor/messages/MoneroKeyImageExportInitAck.py index b256412813..fbad4608b6 100644 --- a/core/src/trezor/messages/MoneroKeyImageExportInitAck.py +++ b/core/src/trezor/messages/MoneroKeyImageExportInitAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageExportInitAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroKeyImageExportInitRequest.py b/core/src/trezor/messages/MoneroKeyImageExportInitRequest.py index c39ee80c4a..174f8238fd 100644 --- a/core/src/trezor/messages/MoneroKeyImageExportInitRequest.py +++ b/core/src/trezor/messages/MoneroKeyImageExportInitRequest.py @@ -6,10 +6,10 @@ from .MoneroSubAddressIndicesList import MoneroSubAddressIndicesList if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageExportInitRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroKeyImageSyncFinalAck.py b/core/src/trezor/messages/MoneroKeyImageSyncFinalAck.py index df449f11c1..4c1b1ec1cc 100644 --- a/core/src/trezor/messages/MoneroKeyImageSyncFinalAck.py +++ b/core/src/trezor/messages/MoneroKeyImageSyncFinalAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncFinalAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroKeyImageSyncFinalRequest.py b/core/src/trezor/messages/MoneroKeyImageSyncFinalRequest.py index e9366756ad..0295772ed6 100644 --- a/core/src/trezor/messages/MoneroKeyImageSyncFinalRequest.py +++ b/core/src/trezor/messages/MoneroKeyImageSyncFinalRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncFinalRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroKeyImageSyncStepAck.py b/core/src/trezor/messages/MoneroKeyImageSyncStepAck.py index da0d28dca5..0eda483e21 100644 --- a/core/src/trezor/messages/MoneroKeyImageSyncStepAck.py +++ b/core/src/trezor/messages/MoneroKeyImageSyncStepAck.py @@ -6,10 +6,10 @@ from .MoneroExportedKeyImage import MoneroExportedKeyImage if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncStepAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroKeyImageSyncStepRequest.py b/core/src/trezor/messages/MoneroKeyImageSyncStepRequest.py index 9fd3dfcbb9..a50f0241e7 100644 --- a/core/src/trezor/messages/MoneroKeyImageSyncStepRequest.py +++ b/core/src/trezor/messages/MoneroKeyImageSyncStepRequest.py @@ -6,10 +6,10 @@ from .MoneroTransferDetails import MoneroTransferDetails if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncStepRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroLiveRefreshFinalAck.py b/core/src/trezor/messages/MoneroLiveRefreshFinalAck.py index 3d8167b70c..c14fd38255 100644 --- a/core/src/trezor/messages/MoneroLiveRefreshFinalAck.py +++ b/core/src/trezor/messages/MoneroLiveRefreshFinalAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshFinalAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroLiveRefreshFinalRequest.py b/core/src/trezor/messages/MoneroLiveRefreshFinalRequest.py index 48a4bca5b9..b905aadb70 100644 --- a/core/src/trezor/messages/MoneroLiveRefreshFinalRequest.py +++ b/core/src/trezor/messages/MoneroLiveRefreshFinalRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshFinalRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroLiveRefreshStartAck.py b/core/src/trezor/messages/MoneroLiveRefreshStartAck.py index 9283f76d87..bbc0da01f7 100644 --- a/core/src/trezor/messages/MoneroLiveRefreshStartAck.py +++ b/core/src/trezor/messages/MoneroLiveRefreshStartAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStartAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroLiveRefreshStartRequest.py b/core/src/trezor/messages/MoneroLiveRefreshStartRequest.py index 6cffc897d4..70a5399535 100644 --- a/core/src/trezor/messages/MoneroLiveRefreshStartRequest.py +++ b/core/src/trezor/messages/MoneroLiveRefreshStartRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStartRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroLiveRefreshStepAck.py b/core/src/trezor/messages/MoneroLiveRefreshStepAck.py index 9b5133f64a..07a1c7430a 100644 --- a/core/src/trezor/messages/MoneroLiveRefreshStepAck.py +++ b/core/src/trezor/messages/MoneroLiveRefreshStepAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStepAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroLiveRefreshStepRequest.py b/core/src/trezor/messages/MoneroLiveRefreshStepRequest.py index ceaff811f0..26201b1695 100644 --- a/core/src/trezor/messages/MoneroLiveRefreshStepRequest.py +++ b/core/src/trezor/messages/MoneroLiveRefreshStepRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStepRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroMultisigKLRki.py b/core/src/trezor/messages/MoneroMultisigKLRki.py index 5322d19791..f371cce012 100644 --- a/core/src/trezor/messages/MoneroMultisigKLRki.py +++ b/core/src/trezor/messages/MoneroMultisigKLRki.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroMultisigKLRki(p.MessageType): diff --git a/core/src/trezor/messages/MoneroOutputEntry.py b/core/src/trezor/messages/MoneroOutputEntry.py index 0796380d3c..739bd375d9 100644 --- a/core/src/trezor/messages/MoneroOutputEntry.py +++ b/core/src/trezor/messages/MoneroOutputEntry.py @@ -6,10 +6,10 @@ from .MoneroRctKeyPublic import MoneroRctKeyPublic if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroOutputEntry(p.MessageType): diff --git a/core/src/trezor/messages/MoneroRctKeyPublic.py b/core/src/trezor/messages/MoneroRctKeyPublic.py index 4c3b7099c7..1d9becb5c4 100644 --- a/core/src/trezor/messages/MoneroRctKeyPublic.py +++ b/core/src/trezor/messages/MoneroRctKeyPublic.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroRctKeyPublic(p.MessageType): diff --git a/core/src/trezor/messages/MoneroRingCtSig.py b/core/src/trezor/messages/MoneroRingCtSig.py index 364637d665..2c6659e2b5 100644 --- a/core/src/trezor/messages/MoneroRingCtSig.py +++ b/core/src/trezor/messages/MoneroRingCtSig.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroRingCtSig(p.MessageType): diff --git a/core/src/trezor/messages/MoneroSubAddressIndicesList.py b/core/src/trezor/messages/MoneroSubAddressIndicesList.py index d1cf497063..6f9d22764b 100644 --- a/core/src/trezor/messages/MoneroSubAddressIndicesList.py +++ b/core/src/trezor/messages/MoneroSubAddressIndicesList.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroSubAddressIndicesList(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionAllInputsSetAck.py b/core/src/trezor/messages/MoneroTransactionAllInputsSetAck.py index 69a7f9235b..dc6da29fb8 100644 --- a/core/src/trezor/messages/MoneroTransactionAllInputsSetAck.py +++ b/core/src/trezor/messages/MoneroTransactionAllInputsSetAck.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllInputsSetAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionAllInputsSetRequest.py b/core/src/trezor/messages/MoneroTransactionAllInputsSetRequest.py index af99331a04..c455145c0b 100644 --- a/core/src/trezor/messages/MoneroTransactionAllInputsSetRequest.py +++ b/core/src/trezor/messages/MoneroTransactionAllInputsSetRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllInputsSetRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionAllOutSetAck.py b/core/src/trezor/messages/MoneroTransactionAllOutSetAck.py index 81e9695f14..f5216283f0 100644 --- a/core/src/trezor/messages/MoneroTransactionAllOutSetAck.py +++ b/core/src/trezor/messages/MoneroTransactionAllOutSetAck.py @@ -6,10 +6,10 @@ from .MoneroRingCtSig import MoneroRingCtSig if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllOutSetAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionAllOutSetRequest.py b/core/src/trezor/messages/MoneroTransactionAllOutSetRequest.py index d7c9269624..fc8e257c7f 100644 --- a/core/src/trezor/messages/MoneroTransactionAllOutSetRequest.py +++ b/core/src/trezor/messages/MoneroTransactionAllOutSetRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllOutSetRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionData.py b/core/src/trezor/messages/MoneroTransactionData.py index 1c50d7504f..04536ff16a 100644 --- a/core/src/trezor/messages/MoneroTransactionData.py +++ b/core/src/trezor/messages/MoneroTransactionData.py @@ -7,10 +7,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionData(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionDestinationEntry.py b/core/src/trezor/messages/MoneroTransactionDestinationEntry.py index 7d5fbbc5d0..7a4159284e 100644 --- a/core/src/trezor/messages/MoneroTransactionDestinationEntry.py +++ b/core/src/trezor/messages/MoneroTransactionDestinationEntry.py @@ -6,10 +6,10 @@ from .MoneroAccountPublicAddress import MoneroAccountPublicAddress if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionDestinationEntry(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionFinalAck.py b/core/src/trezor/messages/MoneroTransactionFinalAck.py index 42a72d9a1f..6fff413d75 100644 --- a/core/src/trezor/messages/MoneroTransactionFinalAck.py +++ b/core/src/trezor/messages/MoneroTransactionFinalAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionFinalAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionFinalRequest.py b/core/src/trezor/messages/MoneroTransactionFinalRequest.py index 1f4b7d870e..2acdd29ceb 100644 --- a/core/src/trezor/messages/MoneroTransactionFinalRequest.py +++ b/core/src/trezor/messages/MoneroTransactionFinalRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionFinalRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionInitAck.py b/core/src/trezor/messages/MoneroTransactionInitAck.py index ba3d5689a0..2a94f6aa67 100644 --- a/core/src/trezor/messages/MoneroTransactionInitAck.py +++ b/core/src/trezor/messages/MoneroTransactionInitAck.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInitAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionInitRequest.py b/core/src/trezor/messages/MoneroTransactionInitRequest.py index 46efce19b7..1ab3e0f169 100644 --- a/core/src/trezor/messages/MoneroTransactionInitRequest.py +++ b/core/src/trezor/messages/MoneroTransactionInitRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionData import MoneroTransactionData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInitRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionInputViniAck.py b/core/src/trezor/messages/MoneroTransactionInputViniAck.py index bc2ade25ad..2a03b16032 100644 --- a/core/src/trezor/messages/MoneroTransactionInputViniAck.py +++ b/core/src/trezor/messages/MoneroTransactionInputViniAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputViniAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionInputViniRequest.py b/core/src/trezor/messages/MoneroTransactionInputViniRequest.py index 8702221290..080fc8f741 100644 --- a/core/src/trezor/messages/MoneroTransactionInputViniRequest.py +++ b/core/src/trezor/messages/MoneroTransactionInputViniRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputViniRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionInputsPermutationAck.py b/core/src/trezor/messages/MoneroTransactionInputsPermutationAck.py index 5ee59585d3..f523af9f48 100644 --- a/core/src/trezor/messages/MoneroTransactionInputsPermutationAck.py +++ b/core/src/trezor/messages/MoneroTransactionInputsPermutationAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputsPermutationAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionInputsPermutationRequest.py b/core/src/trezor/messages/MoneroTransactionInputsPermutationRequest.py index 3041a76668..1021bea274 100644 --- a/core/src/trezor/messages/MoneroTransactionInputsPermutationRequest.py +++ b/core/src/trezor/messages/MoneroTransactionInputsPermutationRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputsPermutationRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionRsigData.py b/core/src/trezor/messages/MoneroTransactionRsigData.py index 6b203b8e39..95a2b88e65 100644 --- a/core/src/trezor/messages/MoneroTransactionRsigData.py +++ b/core/src/trezor/messages/MoneroTransactionRsigData.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionRsigData(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSetInputAck.py b/core/src/trezor/messages/MoneroTransactionSetInputAck.py index 52ce021dc9..fe4a5c431c 100644 --- a/core/src/trezor/messages/MoneroTransactionSetInputAck.py +++ b/core/src/trezor/messages/MoneroTransactionSetInputAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetInputAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSetInputRequest.py b/core/src/trezor/messages/MoneroTransactionSetInputRequest.py index fa2e01a262..9f185d532a 100644 --- a/core/src/trezor/messages/MoneroTransactionSetInputRequest.py +++ b/core/src/trezor/messages/MoneroTransactionSetInputRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetInputRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSetOutputAck.py b/core/src/trezor/messages/MoneroTransactionSetOutputAck.py index fe1592c31d..1e3f51da80 100644 --- a/core/src/trezor/messages/MoneroTransactionSetOutputAck.py +++ b/core/src/trezor/messages/MoneroTransactionSetOutputAck.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetOutputAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSetOutputRequest.py b/core/src/trezor/messages/MoneroTransactionSetOutputRequest.py index 445fceb961..1d25d81a30 100644 --- a/core/src/trezor/messages/MoneroTransactionSetOutputRequest.py +++ b/core/src/trezor/messages/MoneroTransactionSetOutputRequest.py @@ -7,10 +7,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetOutputRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSignInputAck.py b/core/src/trezor/messages/MoneroTransactionSignInputAck.py index b74a517781..e72f3c6a28 100644 --- a/core/src/trezor/messages/MoneroTransactionSignInputAck.py +++ b/core/src/trezor/messages/MoneroTransactionSignInputAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSignInputAck(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSignInputRequest.py b/core/src/trezor/messages/MoneroTransactionSignInputRequest.py index 3cfd189b86..557d266e2f 100644 --- a/core/src/trezor/messages/MoneroTransactionSignInputRequest.py +++ b/core/src/trezor/messages/MoneroTransactionSignInputRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSignInputRequest(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransactionSourceEntry.py b/core/src/trezor/messages/MoneroTransactionSourceEntry.py index 574d14325b..0316dff90b 100644 --- a/core/src/trezor/messages/MoneroTransactionSourceEntry.py +++ b/core/src/trezor/messages/MoneroTransactionSourceEntry.py @@ -7,10 +7,10 @@ from .MoneroOutputEntry import MoneroOutputEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSourceEntry(p.MessageType): diff --git a/core/src/trezor/messages/MoneroTransferDetails.py b/core/src/trezor/messages/MoneroTransferDetails.py index d00d2106ab..be9b7ae4b1 100644 --- a/core/src/trezor/messages/MoneroTransferDetails.py +++ b/core/src/trezor/messages/MoneroTransferDetails.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransferDetails(p.MessageType): diff --git a/core/src/trezor/messages/MoneroWatchKey.py b/core/src/trezor/messages/MoneroWatchKey.py index a2844f1581..9e404636b7 100644 --- a/core/src/trezor/messages/MoneroWatchKey.py +++ b/core/src/trezor/messages/MoneroWatchKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroWatchKey(p.MessageType): diff --git a/core/src/trezor/messages/MultisigRedeemScriptType.py b/core/src/trezor/messages/MultisigRedeemScriptType.py index 95427f06f8..3b6ce2aeee 100644 --- a/core/src/trezor/messages/MultisigRedeemScriptType.py +++ b/core/src/trezor/messages/MultisigRedeemScriptType.py @@ -7,10 +7,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MultisigRedeemScriptType(p.MessageType): diff --git a/core/src/trezor/messages/NEMAddress.py b/core/src/trezor/messages/NEMAddress.py index ee61f6adb1..4ab32c5551 100644 --- a/core/src/trezor/messages/NEMAddress.py +++ b/core/src/trezor/messages/NEMAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMAddress(p.MessageType): diff --git a/core/src/trezor/messages/NEMAggregateModification.py b/core/src/trezor/messages/NEMAggregateModification.py index c61ffe72a2..e8bad74808 100644 --- a/core/src/trezor/messages/NEMAggregateModification.py +++ b/core/src/trezor/messages/NEMAggregateModification.py @@ -6,10 +6,10 @@ from .NEMCosignatoryModification import NEMCosignatoryModification if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMAggregateModification(p.MessageType): diff --git a/core/src/trezor/messages/NEMCosignatoryModification.py b/core/src/trezor/messages/NEMCosignatoryModification.py index 173c45704c..7bbe4a92c8 100644 --- a/core/src/trezor/messages/NEMCosignatoryModification.py +++ b/core/src/trezor/messages/NEMCosignatoryModification.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMModificationType = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMModificationType = None # type: ignore + pass class NEMCosignatoryModification(p.MessageType): diff --git a/core/src/trezor/messages/NEMGetAddress.py b/core/src/trezor/messages/NEMGetAddress.py index f6bdc96cbb..00d35f6af7 100644 --- a/core/src/trezor/messages/NEMGetAddress.py +++ b/core/src/trezor/messages/NEMGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/NEMImportanceTransfer.py b/core/src/trezor/messages/NEMImportanceTransfer.py index b9cd99617a..94e398a055 100644 --- a/core/src/trezor/messages/NEMImportanceTransfer.py +++ b/core/src/trezor/messages/NEMImportanceTransfer.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMImportanceTransferMode = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMImportanceTransferMode = None # type: ignore + pass class NEMImportanceTransfer(p.MessageType): diff --git a/core/src/trezor/messages/NEMImportanceTransferMode.py b/core/src/trezor/messages/NEMImportanceTransferMode.py index 912e27eb57..408c471844 100644 --- a/core/src/trezor/messages/NEMImportanceTransferMode.py +++ b/core/src/trezor/messages/NEMImportanceTransferMode.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -ImportanceTransfer_Activate = 1 -ImportanceTransfer_Deactivate = 2 +if False: + from typing_extensions import Literal + +ImportanceTransfer_Activate = 1 # type: Literal[1] +ImportanceTransfer_Deactivate = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/NEMModificationType.py b/core/src/trezor/messages/NEMModificationType.py index ee0f0ad70d..d33d2ca4da 100644 --- a/core/src/trezor/messages/NEMModificationType.py +++ b/core/src/trezor/messages/NEMModificationType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -CosignatoryModification_Add = 1 -CosignatoryModification_Delete = 2 +if False: + from typing_extensions import Literal + +CosignatoryModification_Add = 1 # type: Literal[1] +CosignatoryModification_Delete = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/NEMMosaic.py b/core/src/trezor/messages/NEMMosaic.py index b67c930191..e62a14aadd 100644 --- a/core/src/trezor/messages/NEMMosaic.py +++ b/core/src/trezor/messages/NEMMosaic.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMMosaic(p.MessageType): diff --git a/core/src/trezor/messages/NEMMosaicCreation.py b/core/src/trezor/messages/NEMMosaicCreation.py index 9e7dee307e..30f1fab4cd 100644 --- a/core/src/trezor/messages/NEMMosaicCreation.py +++ b/core/src/trezor/messages/NEMMosaicCreation.py @@ -6,10 +6,10 @@ from .NEMMosaicDefinition import NEMMosaicDefinition if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMMosaicCreation(p.MessageType): diff --git a/core/src/trezor/messages/NEMMosaicDefinition.py b/core/src/trezor/messages/NEMMosaicDefinition.py index 626f50abda..6917138c40 100644 --- a/core/src/trezor/messages/NEMMosaicDefinition.py +++ b/core/src/trezor/messages/NEMMosaicDefinition.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMMosaicLevy = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMMosaicLevy = None # type: ignore + pass class NEMMosaicDefinition(p.MessageType): diff --git a/core/src/trezor/messages/NEMMosaicLevy.py b/core/src/trezor/messages/NEMMosaicLevy.py index bf896c1024..f5a7345790 100644 --- a/core/src/trezor/messages/NEMMosaicLevy.py +++ b/core/src/trezor/messages/NEMMosaicLevy.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -MosaicLevy_Absolute = 1 -MosaicLevy_Percentile = 2 +if False: + from typing_extensions import Literal + +MosaicLevy_Absolute = 1 # type: Literal[1] +MosaicLevy_Percentile = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/NEMMosaicSupplyChange.py b/core/src/trezor/messages/NEMMosaicSupplyChange.py index abc88e677b..0d8c90d51a 100644 --- a/core/src/trezor/messages/NEMMosaicSupplyChange.py +++ b/core/src/trezor/messages/NEMMosaicSupplyChange.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMSupplyChangeType = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMSupplyChangeType = None # type: ignore + pass class NEMMosaicSupplyChange(p.MessageType): diff --git a/core/src/trezor/messages/NEMProvisionNamespace.py b/core/src/trezor/messages/NEMProvisionNamespace.py index e62611983f..8c2838a6c0 100644 --- a/core/src/trezor/messages/NEMProvisionNamespace.py +++ b/core/src/trezor/messages/NEMProvisionNamespace.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMProvisionNamespace(p.MessageType): diff --git a/core/src/trezor/messages/NEMSignTx.py b/core/src/trezor/messages/NEMSignTx.py index 6d9c16ee42..40a71fe318 100644 --- a/core/src/trezor/messages/NEMSignTx.py +++ b/core/src/trezor/messages/NEMSignTx.py @@ -12,10 +12,10 @@ from .NEMTransfer import NEMTransfer if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMSignTx(p.MessageType): diff --git a/core/src/trezor/messages/NEMSignedTx.py b/core/src/trezor/messages/NEMSignedTx.py index 141a2700ea..e5c8fb057a 100644 --- a/core/src/trezor/messages/NEMSignedTx.py +++ b/core/src/trezor/messages/NEMSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/NEMSupplyChangeType.py b/core/src/trezor/messages/NEMSupplyChangeType.py index 1a4f79b94f..77f12b16ca 100644 --- a/core/src/trezor/messages/NEMSupplyChangeType.py +++ b/core/src/trezor/messages/NEMSupplyChangeType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -SupplyChange_Increase = 1 -SupplyChange_Decrease = 2 +if False: + from typing_extensions import Literal + +SupplyChange_Increase = 1 # type: Literal[1] +SupplyChange_Decrease = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/NEMTransactionCommon.py b/core/src/trezor/messages/NEMTransactionCommon.py index 2fd9530868..bb1b96da07 100644 --- a/core/src/trezor/messages/NEMTransactionCommon.py +++ b/core/src/trezor/messages/NEMTransactionCommon.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMTransactionCommon(p.MessageType): diff --git a/core/src/trezor/messages/NEMTransfer.py b/core/src/trezor/messages/NEMTransfer.py index 581b71e76a..9963e373b8 100644 --- a/core/src/trezor/messages/NEMTransfer.py +++ b/core/src/trezor/messages/NEMTransfer.py @@ -6,10 +6,10 @@ from .NEMMosaic import NEMMosaic if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMTransfer(p.MessageType): diff --git a/core/src/trezor/messages/OutputScriptType.py b/core/src/trezor/messages/OutputScriptType.py index 6a9b7eb391..bd334789c8 100644 --- a/core/src/trezor/messages/OutputScriptType.py +++ b/core/src/trezor/messages/OutputScriptType.py @@ -1,8 +1,11 @@ # Automatically generated by pb2py # fmt: off -PAYTOADDRESS = 0 -PAYTOSCRIPTHASH = 1 -PAYTOMULTISIG = 2 -PAYTOOPRETURN = 3 -PAYTOWITNESS = 4 -PAYTOP2SHWITNESS = 5 +if False: + from typing_extensions import Literal + +PAYTOADDRESS = 0 # type: Literal[0] +PAYTOSCRIPTHASH = 1 # type: Literal[1] +PAYTOMULTISIG = 2 # type: Literal[2] +PAYTOOPRETURN = 3 # type: Literal[3] +PAYTOWITNESS = 4 # type: Literal[4] +PAYTOP2SHWITNESS = 5 # type: Literal[5] diff --git a/core/src/trezor/messages/PassphraseAck.py b/core/src/trezor/messages/PassphraseAck.py index b9759316fa..3e965b0e25 100644 --- a/core/src/trezor/messages/PassphraseAck.py +++ b/core/src/trezor/messages/PassphraseAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseAck(p.MessageType): diff --git a/core/src/trezor/messages/PassphraseRequest.py b/core/src/trezor/messages/PassphraseRequest.py index 9cc415e9f0..21395653ac 100644 --- a/core/src/trezor/messages/PassphraseRequest.py +++ b/core/src/trezor/messages/PassphraseRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseRequest(p.MessageType): diff --git a/core/src/trezor/messages/PassphraseSourceType.py b/core/src/trezor/messages/PassphraseSourceType.py index 3bce46d10a..d62ea047d3 100644 --- a/core/src/trezor/messages/PassphraseSourceType.py +++ b/core/src/trezor/messages/PassphraseSourceType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -ASK = 0 -DEVICE = 1 -HOST = 2 +if False: + from typing_extensions import Literal + +ASK = 0 # type: Literal[0] +DEVICE = 1 # type: Literal[1] +HOST = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/PassphraseStateAck.py b/core/src/trezor/messages/PassphraseStateAck.py index 8b9005d913..3846fc5f8b 100644 --- a/core/src/trezor/messages/PassphraseStateAck.py +++ b/core/src/trezor/messages/PassphraseStateAck.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseStateAck(p.MessageType): diff --git a/core/src/trezor/messages/PassphraseStateRequest.py b/core/src/trezor/messages/PassphraseStateRequest.py index 6ac770a78d..5dbac3b33e 100644 --- a/core/src/trezor/messages/PassphraseStateRequest.py +++ b/core/src/trezor/messages/PassphraseStateRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseStateRequest(p.MessageType): diff --git a/core/src/trezor/messages/Ping.py b/core/src/trezor/messages/Ping.py index 149244ee67..3a7134b716 100644 --- a/core/src/trezor/messages/Ping.py +++ b/core/src/trezor/messages/Ping.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Ping(p.MessageType): diff --git a/core/src/trezor/messages/PublicKey.py b/core/src/trezor/messages/PublicKey.py index b5f92b086c..741d633599 100644 --- a/core/src/trezor/messages/PublicKey.py +++ b/core/src/trezor/messages/PublicKey.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PublicKey(p.MessageType): diff --git a/core/src/trezor/messages/RecoveryDevice.py b/core/src/trezor/messages/RecoveryDevice.py index e0eab7da21..2aab379095 100644 --- a/core/src/trezor/messages/RecoveryDevice.py +++ b/core/src/trezor/messages/RecoveryDevice.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeRecoveryDeviceType = Literal[0, 1] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeRecoveryDeviceType = None # type: ignore + pass class RecoveryDevice(p.MessageType): diff --git a/core/src/trezor/messages/RecoveryDeviceType.py b/core/src/trezor/messages/RecoveryDeviceType.py index f6f643ac72..6a87da0009 100644 --- a/core/src/trezor/messages/RecoveryDeviceType.py +++ b/core/src/trezor/messages/RecoveryDeviceType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -ScrambledWords = 0 -Matrix = 1 +if False: + from typing_extensions import Literal + +ScrambledWords = 0 # type: Literal[0] +Matrix = 1 # type: Literal[1] diff --git a/core/src/trezor/messages/RequestType.py b/core/src/trezor/messages/RequestType.py index 4c122c9447..810076752b 100644 --- a/core/src/trezor/messages/RequestType.py +++ b/core/src/trezor/messages/RequestType.py @@ -1,7 +1,10 @@ # Automatically generated by pb2py # fmt: off -TXINPUT = 0 -TXOUTPUT = 1 -TXMETA = 2 -TXFINISHED = 3 -TXEXTRADATA = 4 +if False: + from typing_extensions import Literal + +TXINPUT = 0 # type: Literal[0] +TXOUTPUT = 1 # type: Literal[1] +TXMETA = 2 # type: Literal[2] +TXFINISHED = 3 # type: Literal[3] +TXEXTRADATA = 4 # type: Literal[4] diff --git a/core/src/trezor/messages/ResetDevice.py b/core/src/trezor/messages/ResetDevice.py index 58fb249dce..abe192ae1f 100644 --- a/core/src/trezor/messages/ResetDevice.py +++ b/core/src/trezor/messages/ResetDevice.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeBackupType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeBackupType = None # type: ignore + pass class ResetDevice(p.MessageType): diff --git a/core/src/trezor/messages/RippleAddress.py b/core/src/trezor/messages/RippleAddress.py index f0f9a381b6..1046827131 100644 --- a/core/src/trezor/messages/RippleAddress.py +++ b/core/src/trezor/messages/RippleAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleAddress(p.MessageType): diff --git a/core/src/trezor/messages/RippleGetAddress.py b/core/src/trezor/messages/RippleGetAddress.py index 728d81b9a1..3bb24ea50c 100644 --- a/core/src/trezor/messages/RippleGetAddress.py +++ b/core/src/trezor/messages/RippleGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/RipplePayment.py b/core/src/trezor/messages/RipplePayment.py index 3439a48569..ae4890c658 100644 --- a/core/src/trezor/messages/RipplePayment.py +++ b/core/src/trezor/messages/RipplePayment.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RipplePayment(p.MessageType): diff --git a/core/src/trezor/messages/RippleSignTx.py b/core/src/trezor/messages/RippleSignTx.py index 0d34711448..f576286c76 100644 --- a/core/src/trezor/messages/RippleSignTx.py +++ b/core/src/trezor/messages/RippleSignTx.py @@ -6,10 +6,10 @@ from .RipplePayment import RipplePayment if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleSignTx(p.MessageType): diff --git a/core/src/trezor/messages/RippleSignedTx.py b/core/src/trezor/messages/RippleSignedTx.py index 933ef7286b..1d8886c0ad 100644 --- a/core/src/trezor/messages/RippleSignedTx.py +++ b/core/src/trezor/messages/RippleSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/SdProtect.py b/core/src/trezor/messages/SdProtect.py index 38fc0c62ca..211b23402b 100644 --- a/core/src/trezor/messages/SdProtect.py +++ b/core/src/trezor/messages/SdProtect.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeSdProtectOperationType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeSdProtectOperationType = None # type: ignore + pass class SdProtect(p.MessageType): diff --git a/core/src/trezor/messages/SdProtectOperationType.py b/core/src/trezor/messages/SdProtectOperationType.py index c3960723b1..17e1b0d4b9 100644 --- a/core/src/trezor/messages/SdProtectOperationType.py +++ b/core/src/trezor/messages/SdProtectOperationType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -DISABLE = 0 -ENABLE = 1 -REFRESH = 2 +if False: + from typing_extensions import Literal + +DISABLE = 0 # type: Literal[0] +ENABLE = 1 # type: Literal[1] +REFRESH = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/SetU2FCounter.py b/core/src/trezor/messages/SetU2FCounter.py index 6b80261a31..532acea5b4 100644 --- a/core/src/trezor/messages/SetU2FCounter.py +++ b/core/src/trezor/messages/SetU2FCounter.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SetU2FCounter(p.MessageType): diff --git a/core/src/trezor/messages/SignIdentity.py b/core/src/trezor/messages/SignIdentity.py index 5674853cf0..6002e6924e 100644 --- a/core/src/trezor/messages/SignIdentity.py +++ b/core/src/trezor/messages/SignIdentity.py @@ -6,10 +6,10 @@ from .IdentityType import IdentityType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SignIdentity(p.MessageType): diff --git a/core/src/trezor/messages/SignMessage.py b/core/src/trezor/messages/SignMessage.py index 2e375f9524..ea4b645615 100644 --- a/core/src/trezor/messages/SignMessage.py +++ b/core/src/trezor/messages/SignMessage.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class SignMessage(p.MessageType): diff --git a/core/src/trezor/messages/SignTx.py b/core/src/trezor/messages/SignTx.py index e1ae2148a2..67e5b3ebcd 100644 --- a/core/src/trezor/messages/SignTx.py +++ b/core/src/trezor/messages/SignTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SignTx(p.MessageType): diff --git a/core/src/trezor/messages/SignedIdentity.py b/core/src/trezor/messages/SignedIdentity.py index 009023df2c..0acafb262b 100644 --- a/core/src/trezor/messages/SignedIdentity.py +++ b/core/src/trezor/messages/SignedIdentity.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SignedIdentity(p.MessageType): diff --git a/core/src/trezor/messages/StellarAccountMergeOp.py b/core/src/trezor/messages/StellarAccountMergeOp.py index 8f8cd24d03..984a875d93 100644 --- a/core/src/trezor/messages/StellarAccountMergeOp.py +++ b/core/src/trezor/messages/StellarAccountMergeOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAccountMergeOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarAddress.py b/core/src/trezor/messages/StellarAddress.py index c2a6aba497..24a0dc30e6 100644 --- a/core/src/trezor/messages/StellarAddress.py +++ b/core/src/trezor/messages/StellarAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAddress(p.MessageType): diff --git a/core/src/trezor/messages/StellarAllowTrustOp.py b/core/src/trezor/messages/StellarAllowTrustOp.py index a49a7b0796..bf4e2106df 100644 --- a/core/src/trezor/messages/StellarAllowTrustOp.py +++ b/core/src/trezor/messages/StellarAllowTrustOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAllowTrustOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarAssetType.py b/core/src/trezor/messages/StellarAssetType.py index 686c1c5361..6ddb768066 100644 --- a/core/src/trezor/messages/StellarAssetType.py +++ b/core/src/trezor/messages/StellarAssetType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAssetType(p.MessageType): diff --git a/core/src/trezor/messages/StellarBumpSequenceOp.py b/core/src/trezor/messages/StellarBumpSequenceOp.py index 5d06c35a63..fb940278f5 100644 --- a/core/src/trezor/messages/StellarBumpSequenceOp.py +++ b/core/src/trezor/messages/StellarBumpSequenceOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarBumpSequenceOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarChangeTrustOp.py b/core/src/trezor/messages/StellarChangeTrustOp.py index c010123b58..00c1588b91 100644 --- a/core/src/trezor/messages/StellarChangeTrustOp.py +++ b/core/src/trezor/messages/StellarChangeTrustOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarChangeTrustOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarCreateAccountOp.py b/core/src/trezor/messages/StellarCreateAccountOp.py index aa3020cc8f..8e368e0e7c 100644 --- a/core/src/trezor/messages/StellarCreateAccountOp.py +++ b/core/src/trezor/messages/StellarCreateAccountOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarCreateAccountOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarCreatePassiveOfferOp.py b/core/src/trezor/messages/StellarCreatePassiveOfferOp.py index 3a695d5e11..d3fbdf69d3 100644 --- a/core/src/trezor/messages/StellarCreatePassiveOfferOp.py +++ b/core/src/trezor/messages/StellarCreatePassiveOfferOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarCreatePassiveOfferOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarGetAddress.py b/core/src/trezor/messages/StellarGetAddress.py index 1771c73536..b893fb7804 100644 --- a/core/src/trezor/messages/StellarGetAddress.py +++ b/core/src/trezor/messages/StellarGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/StellarManageDataOp.py b/core/src/trezor/messages/StellarManageDataOp.py index b04e039469..97818251ad 100644 --- a/core/src/trezor/messages/StellarManageDataOp.py +++ b/core/src/trezor/messages/StellarManageDataOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarManageDataOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarManageOfferOp.py b/core/src/trezor/messages/StellarManageOfferOp.py index e72024861c..9eb97238e1 100644 --- a/core/src/trezor/messages/StellarManageOfferOp.py +++ b/core/src/trezor/messages/StellarManageOfferOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarManageOfferOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarPathPaymentOp.py b/core/src/trezor/messages/StellarPathPaymentOp.py index 6614b0166b..4a89a01722 100644 --- a/core/src/trezor/messages/StellarPathPaymentOp.py +++ b/core/src/trezor/messages/StellarPathPaymentOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarPathPaymentOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarPaymentOp.py b/core/src/trezor/messages/StellarPaymentOp.py index b176023541..7b55bef342 100644 --- a/core/src/trezor/messages/StellarPaymentOp.py +++ b/core/src/trezor/messages/StellarPaymentOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarPaymentOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarSetOptionsOp.py b/core/src/trezor/messages/StellarSetOptionsOp.py index cfa6b7d24b..7061d4b397 100644 --- a/core/src/trezor/messages/StellarSetOptionsOp.py +++ b/core/src/trezor/messages/StellarSetOptionsOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarSetOptionsOp(p.MessageType): diff --git a/core/src/trezor/messages/StellarSignTx.py b/core/src/trezor/messages/StellarSignTx.py index 148b2a5e1c..d7296e5f47 100644 --- a/core/src/trezor/messages/StellarSignTx.py +++ b/core/src/trezor/messages/StellarSignTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarSignTx(p.MessageType): diff --git a/core/src/trezor/messages/StellarSignedTx.py b/core/src/trezor/messages/StellarSignedTx.py index e5a62fcdfd..9d95186885 100644 --- a/core/src/trezor/messages/StellarSignedTx.py +++ b/core/src/trezor/messages/StellarSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/StellarTxOpRequest.py b/core/src/trezor/messages/StellarTxOpRequest.py index e4d91f74c9..7efdbbb84e 100644 --- a/core/src/trezor/messages/StellarTxOpRequest.py +++ b/core/src/trezor/messages/StellarTxOpRequest.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarTxOpRequest(p.MessageType): diff --git a/core/src/trezor/messages/Success.py b/core/src/trezor/messages/Success.py index 46984b8785..086331b9f9 100644 --- a/core/src/trezor/messages/Success.py +++ b/core/src/trezor/messages/Success.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Success(p.MessageType): diff --git a/core/src/trezor/messages/TezosAddress.py b/core/src/trezor/messages/TezosAddress.py index 9e16b6d506..8013249cba 100644 --- a/core/src/trezor/messages/TezosAddress.py +++ b/core/src/trezor/messages/TezosAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosAddress(p.MessageType): diff --git a/core/src/trezor/messages/TezosBallotOp.py b/core/src/trezor/messages/TezosBallotOp.py index b71a7a1470..3f702ccc2f 100644 --- a/core/src/trezor/messages/TezosBallotOp.py +++ b/core/src/trezor/messages/TezosBallotOp.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeTezosBallotType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeTezosBallotType = None # type: ignore + pass class TezosBallotOp(p.MessageType): diff --git a/core/src/trezor/messages/TezosBallotType.py b/core/src/trezor/messages/TezosBallotType.py index 1d955862f5..d32901955c 100644 --- a/core/src/trezor/messages/TezosBallotType.py +++ b/core/src/trezor/messages/TezosBallotType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -Yay = 0 -Nay = 1 -Pass = 2 +if False: + from typing_extensions import Literal + +Yay = 0 # type: Literal[0] +Nay = 1 # type: Literal[1] +Pass = 2 # type: Literal[2] diff --git a/core/src/trezor/messages/TezosContractID.py b/core/src/trezor/messages/TezosContractID.py index 57bccee411..aefbb4f156 100644 --- a/core/src/trezor/messages/TezosContractID.py +++ b/core/src/trezor/messages/TezosContractID.py @@ -4,12 +4,11 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeTezosContractType = Literal[0, 1] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeTezosContractType = None # type: ignore + pass class TezosContractID(p.MessageType): diff --git a/core/src/trezor/messages/TezosContractType.py b/core/src/trezor/messages/TezosContractType.py index 04275b086c..211f451e22 100644 --- a/core/src/trezor/messages/TezosContractType.py +++ b/core/src/trezor/messages/TezosContractType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -Implicit = 0 -Originated = 1 +if False: + from typing_extensions import Literal + +Implicit = 0 # type: Literal[0] +Originated = 1 # type: Literal[1] diff --git a/core/src/trezor/messages/TezosDelegationOp.py b/core/src/trezor/messages/TezosDelegationOp.py index 238845ac6c..dea07f62b5 100644 --- a/core/src/trezor/messages/TezosDelegationOp.py +++ b/core/src/trezor/messages/TezosDelegationOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosDelegationOp(p.MessageType): diff --git a/core/src/trezor/messages/TezosGetAddress.py b/core/src/trezor/messages/TezosGetAddress.py index 78904b690f..c3de399a7e 100644 --- a/core/src/trezor/messages/TezosGetAddress.py +++ b/core/src/trezor/messages/TezosGetAddress.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosGetAddress(p.MessageType): diff --git a/core/src/trezor/messages/TezosGetPublicKey.py b/core/src/trezor/messages/TezosGetPublicKey.py index 96fff888c9..d18d701abb 100644 --- a/core/src/trezor/messages/TezosGetPublicKey.py +++ b/core/src/trezor/messages/TezosGetPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosGetPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/TezosOriginationOp.py b/core/src/trezor/messages/TezosOriginationOp.py index a4c332ef4a..3d9561c458 100644 --- a/core/src/trezor/messages/TezosOriginationOp.py +++ b/core/src/trezor/messages/TezosOriginationOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosOriginationOp(p.MessageType): diff --git a/core/src/trezor/messages/TezosProposalOp.py b/core/src/trezor/messages/TezosProposalOp.py index 1c651b8ac4..b4730383ca 100644 --- a/core/src/trezor/messages/TezosProposalOp.py +++ b/core/src/trezor/messages/TezosProposalOp.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosProposalOp(p.MessageType): diff --git a/core/src/trezor/messages/TezosPublicKey.py b/core/src/trezor/messages/TezosPublicKey.py index a697f82e0e..eedc711381 100644 --- a/core/src/trezor/messages/TezosPublicKey.py +++ b/core/src/trezor/messages/TezosPublicKey.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosPublicKey(p.MessageType): diff --git a/core/src/trezor/messages/TezosRevealOp.py b/core/src/trezor/messages/TezosRevealOp.py index 3691322b95..dda5f8b86a 100644 --- a/core/src/trezor/messages/TezosRevealOp.py +++ b/core/src/trezor/messages/TezosRevealOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosRevealOp(p.MessageType): diff --git a/core/src/trezor/messages/TezosSignTx.py b/core/src/trezor/messages/TezosSignTx.py index 308ed70c32..3d85a87928 100644 --- a/core/src/trezor/messages/TezosSignTx.py +++ b/core/src/trezor/messages/TezosSignTx.py @@ -11,10 +11,10 @@ from .TezosTransactionOp import TezosTransactionOp if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosSignTx(p.MessageType): diff --git a/core/src/trezor/messages/TezosSignedTx.py b/core/src/trezor/messages/TezosSignedTx.py index 011e6855a7..1e3902a210 100644 --- a/core/src/trezor/messages/TezosSignedTx.py +++ b/core/src/trezor/messages/TezosSignedTx.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosSignedTx(p.MessageType): diff --git a/core/src/trezor/messages/TezosTransactionOp.py b/core/src/trezor/messages/TezosTransactionOp.py index 370bd3a127..308e7961f8 100644 --- a/core/src/trezor/messages/TezosTransactionOp.py +++ b/core/src/trezor/messages/TezosTransactionOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosTransactionOp(p.MessageType): diff --git a/core/src/trezor/messages/TransactionType.py b/core/src/trezor/messages/TransactionType.py index cdcdb5b464..0d239f6bd5 100644 --- a/core/src/trezor/messages/TransactionType.py +++ b/core/src/trezor/messages/TransactionType.py @@ -8,10 +8,10 @@ from .TxOutputType import TxOutputType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TransactionType(p.MessageType): diff --git a/core/src/trezor/messages/TxAck.py b/core/src/trezor/messages/TxAck.py index 5015e9b08b..c34f196e8b 100644 --- a/core/src/trezor/messages/TxAck.py +++ b/core/src/trezor/messages/TxAck.py @@ -6,10 +6,10 @@ from .TransactionType import TransactionType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxAck(p.MessageType): diff --git a/core/src/trezor/messages/TxInputType.py b/core/src/trezor/messages/TxInputType.py index c089d4a6e4..ebe66e776a 100644 --- a/core/src/trezor/messages/TxInputType.py +++ b/core/src/trezor/messages/TxInputType.py @@ -6,12 +6,11 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class TxInputType(p.MessageType): diff --git a/core/src/trezor/messages/TxOutputBinType.py b/core/src/trezor/messages/TxOutputBinType.py index 8a8744217b..ea6f25b069 100644 --- a/core/src/trezor/messages/TxOutputBinType.py +++ b/core/src/trezor/messages/TxOutputBinType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxOutputBinType(p.MessageType): diff --git a/core/src/trezor/messages/TxOutputType.py b/core/src/trezor/messages/TxOutputType.py index e1f271f62e..bac5725068 100644 --- a/core/src/trezor/messages/TxOutputType.py +++ b/core/src/trezor/messages/TxOutputType.py @@ -6,12 +6,11 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeOutputScriptType = Literal[0, 1, 2, 3, 4, 5] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeOutputScriptType = None # type: ignore + pass class TxOutputType(p.MessageType): diff --git a/core/src/trezor/messages/TxRequest.py b/core/src/trezor/messages/TxRequest.py index 0c8a4d4396..07b1725fff 100644 --- a/core/src/trezor/messages/TxRequest.py +++ b/core/src/trezor/messages/TxRequest.py @@ -7,12 +7,11 @@ from .TxRequestSerializedType import TxRequestSerializedType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeRequestType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeRequestType = None # type: ignore + pass class TxRequest(p.MessageType): diff --git a/core/src/trezor/messages/TxRequestDetailsType.py b/core/src/trezor/messages/TxRequestDetailsType.py index 31df83363b..ee411fb12d 100644 --- a/core/src/trezor/messages/TxRequestDetailsType.py +++ b/core/src/trezor/messages/TxRequestDetailsType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxRequestDetailsType(p.MessageType): diff --git a/core/src/trezor/messages/TxRequestSerializedType.py b/core/src/trezor/messages/TxRequestSerializedType.py index aa92bd3dc1..73636a20d1 100644 --- a/core/src/trezor/messages/TxRequestSerializedType.py +++ b/core/src/trezor/messages/TxRequestSerializedType.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxRequestSerializedType(p.MessageType): diff --git a/core/src/trezor/messages/VerifyMessage.py b/core/src/trezor/messages/VerifyMessage.py index 6527f2bad4..8e7886c1f0 100644 --- a/core/src/trezor/messages/VerifyMessage.py +++ b/core/src/trezor/messages/VerifyMessage.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class VerifyMessage(p.MessageType): diff --git a/core/src/trezor/messages/WebAuthnAddResidentCredential.py b/core/src/trezor/messages/WebAuthnAddResidentCredential.py index f95f352e3d..90907037a6 100644 --- a/core/src/trezor/messages/WebAuthnAddResidentCredential.py +++ b/core/src/trezor/messages/WebAuthnAddResidentCredential.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnAddResidentCredential(p.MessageType): diff --git a/core/src/trezor/messages/WebAuthnCredential.py b/core/src/trezor/messages/WebAuthnCredential.py index a2155c1d4f..81eed78282 100644 --- a/core/src/trezor/messages/WebAuthnCredential.py +++ b/core/src/trezor/messages/WebAuthnCredential.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnCredential(p.MessageType): diff --git a/core/src/trezor/messages/WebAuthnCredentials.py b/core/src/trezor/messages/WebAuthnCredentials.py index 6659f98b00..b90a7fa031 100644 --- a/core/src/trezor/messages/WebAuthnCredentials.py +++ b/core/src/trezor/messages/WebAuthnCredentials.py @@ -6,10 +6,10 @@ from .WebAuthnCredential import WebAuthnCredential if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnCredentials(p.MessageType): diff --git a/core/src/trezor/messages/WebAuthnListResidentCredentials.py b/core/src/trezor/messages/WebAuthnListResidentCredentials.py index e88ad3976b..6c67d9170d 100644 --- a/core/src/trezor/messages/WebAuthnListResidentCredentials.py +++ b/core/src/trezor/messages/WebAuthnListResidentCredentials.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnListResidentCredentials(p.MessageType): diff --git a/core/src/trezor/messages/WebAuthnRemoveResidentCredential.py b/core/src/trezor/messages/WebAuthnRemoveResidentCredential.py index 956d8956e4..89eb729b66 100644 --- a/core/src/trezor/messages/WebAuthnRemoveResidentCredential.py +++ b/core/src/trezor/messages/WebAuthnRemoveResidentCredential.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnRemoveResidentCredential(p.MessageType): diff --git a/core/src/trezor/messages/WipeDevice.py b/core/src/trezor/messages/WipeDevice.py index 4557d2f302..6e001cb434 100644 --- a/core/src/trezor/messages/WipeDevice.py +++ b/core/src/trezor/messages/WipeDevice.py @@ -4,10 +4,10 @@ import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WipeDevice(p.MessageType): diff --git a/core/src/trezor/messages/__init__.py b/core/src/trezor/messages/__init__.py index ff76fac74d..bf7c2a20f3 100644 --- a/core/src/trezor/messages/__init__.py +++ b/core/src/trezor/messages/__init__.py @@ -28,9 +28,7 @@ def get_type(wire_type: int) -> MessageClass: else: # import message class from trezor.messages dynamically name = type_to_name[wire_type] - module = __import__( # type: ignore - "trezor.messages.%s" % name, None, None, (name,), 0 - ) + module = __import__("trezor.messages.%s" % name, None, None, (name,), 0) msg_type = getattr(module, name) return msg_type diff --git a/core/src/trezor/ui/__init__.py b/core/src/trezor/ui/__init__.py index 5d04127b65..6ea7cdb4a5 100644 --- a/core/src/trezor/ui/__init__.py +++ b/core/src/trezor/ui/__init__.py @@ -6,7 +6,7 @@ from trezorui import Display from trezor import io, loop, res, utils if False: - from typing import Any, Generator, Tuple, TypeVar + from typing import Any, Awaitable, Generator, Tuple, TypeVar Pos = Tuple[int, int] Area = Tuple[int, int, int, int] @@ -334,6 +334,6 @@ class Layout(Component): self.dispatch(RENDER, 0, 0) -def wait_until_layout_is_running(): +def wait_until_layout_is_running() -> Awaitable[None]: # type: ignore while not layout_chan.takers: yield diff --git a/core/src/trezor/ui/button.py b/core/src/trezor/ui/button.py index 411c2c4a7b..7fed32e1b4 100644 --- a/core/src/trezor/ui/button.py +++ b/core/src/trezor/ui/button.py @@ -4,7 +4,7 @@ from trezor import ui from trezor.ui import display, in_area if False: - from typing import Type, Union + from typing import Type, Union, Optional class ButtonDefault: @@ -102,7 +102,7 @@ class ButtonMonoConfirm(ButtonDefault): if False: - ButtonContent = Union[str, bytes] + ButtonContent = Optional[Union[str, bytes]] ButtonStyleType = Type[ButtonDefault] ButtonStyleStateType = Type[ButtonDefault.normal] diff --git a/core/src/trezor/ui/confirm.py b/core/src/trezor/ui/confirm.py index 4e71aa6db4..31bc5b34f7 100644 --- a/core/src/trezor/ui/confirm.py +++ b/core/src/trezor/ui/confirm.py @@ -178,7 +178,7 @@ class InfoConfirm(ui.Layout): self.confirm.on_click = self.on_confirm # type: ignore self.info = Button(ui.grid(13), info, info_style) - self.info.on_click = self.on_info + self.info.on_click = self.on_info # type: ignore self.cancel = Button(ui.grid(12), cancel, cancel_style) self.cancel.on_click = self.on_cancel # type: ignore diff --git a/core/src/trezor/ui/qr.py b/core/src/trezor/ui/qr.py index 3389172ae0..73ca541a11 100644 --- a/core/src/trezor/ui/qr.py +++ b/core/src/trezor/ui/qr.py @@ -2,11 +2,11 @@ from trezor import ui class Qr(ui.Component): - def __init__(self, data: bytes, x: int, y: int, scale: int): + def __init__(self, data: str, x: int, y: int, scale: int): self.data = data self.x = x self.y = y self.scale = scale def on_render(self) -> None: - ui.display.qrcode(self.x, self.y, self.data, self.scale) + ui.display.qrcode(self.x, self.y, self.data.encode(), self.scale) diff --git a/core/src/trezor/ui/scroll.py b/core/src/trezor/ui/scroll.py index 37bf8e68fa..fe6d3f5153 100644 --- a/core/src/trezor/ui/scroll.py +++ b/core/src/trezor/ui/scroll.py @@ -9,7 +9,7 @@ if __debug__: from apps.debug import swipe_signal if False: - from typing import Tuple, Sequence + from typing import Tuple, List def render_scrollbar(pages: int, page: int) -> None: @@ -46,7 +46,7 @@ def render_swipe_text() -> None: class Paginated(ui.Layout): def __init__( - self, pages: Sequence[ui.Component], page: int = 0, one_by_one: bool = False + self, pages: List[ui.Component], page: int = 0, one_by_one: bool = False ): self.pages = pages self.page = page @@ -157,7 +157,7 @@ class PageWithButtons(ui.Component): class PaginatedWithButtons(ui.Layout): def __init__( - self, pages: Sequence[ui.Component], page: int = 0, one_by_one: bool = False + self, pages: List[ui.Component], page: int = 0, one_by_one: bool = False ) -> None: self.pages = [ PageWithButtons(p, self, i, len(pages)) for i, p in enumerate(pages) diff --git a/core/src/trezor/ui/text.py b/core/src/trezor/ui/text.py index 5ad7a05f7d..0d84180f12 100644 --- a/core/src/trezor/ui/text.py +++ b/core/src/trezor/ui/text.py @@ -134,7 +134,7 @@ class Text(ui.Component): self.icon_color = icon_color self.max_lines = max_lines self.new_lines = new_lines - self.content = [] # type: List[Union[str, int]] + self.content = [] # type: List[TextContent] self.repaint = True def normal(self, *content: TextContent) -> None: diff --git a/core/src/trezor/utils.py b/core/src/trezor/utils.py index f387923592..f00c29327a 100644 --- a/core/src/trezor/utils.py +++ b/core/src/trezor/utils.py @@ -1,6 +1,6 @@ import gc import sys -from trezorutils import ( # noqa: F401 +from trezorutils import ( # type: ignore[attr-defined] # noqa: F401 BITCOIN_ONLY, EMULATOR, GITREV, @@ -29,7 +29,7 @@ if __debug__: LOG_MEMORY = 0 if False: - from typing import Iterable, Iterator, Protocol, List, TypeVar + from typing import Any, Iterable, Iterator, Protocol, TypeVar, Sequence def unimport_begin() -> Iterable[str]: @@ -66,10 +66,10 @@ def ensure(cond: bool, msg: str = None) -> None: if False: - Chunked = TypeVar("Chunked") + Chunkable = TypeVar("Chunkable", str, Sequence[Any]) -def chunks(items: List[Chunked], size: int) -> Iterator[List[Chunked]]: +def chunks(items: Chunkable, size: int) -> Iterator[Chunkable]: for i in range(0, len(items), size): yield items[i : i + size] diff --git a/core/src/trezor/wire/__init__.py b/core/src/trezor/wire/__init__.py index 91311a7863..7c99e4e281 100644 --- a/core/src/trezor/wire/__init__.py +++ b/core/src/trezor/wire/__init__.py @@ -241,6 +241,10 @@ class UnexpectedMessageError(Exception): async def handle_session(iface: WireInterface, session_id: int) -> None: ctx = Context(iface, session_id) next_reader = None # type: Optional[codec_v1.Reader] + res_msg = None + req_reader = None + req_type = None + req_msg = None while True: try: if next_reader is None: @@ -404,9 +408,9 @@ def get_workflow_handler(reader: codec_v1.Reader) -> Optional[Handler]: return handler -def import_workflow(pkgname: str, modname: str) -> Handler: +def import_workflow(pkgname: str, modname: str) -> Any: modpath = "%s.%s" % (pkgname, modname) - module = __import__(modpath, None, None, (modname,), 0) # type: ignore + module = __import__(modpath, None, None, (modname,), 0) handler = getattr(module, modname) return handler diff --git a/core/src/trezor/wire/errors.py b/core/src/trezor/wire/errors.py index 2e38e3ca6b..cc4f490b0b 100644 --- a/core/src/trezor/wire/errors.py +++ b/core/src/trezor/wire/errors.py @@ -1,8 +1,11 @@ from trezor.messages import FailureType +if False: + from trezor.messages.Failure import EnumTypeFailureType + class Error(Exception): - def __init__(self, code: int, message: str) -> None: + def __init__(self, code: EnumTypeFailureType, message: str) -> None: super().__init__() self.code = code self.message = message diff --git a/core/src/trezor/workflow.py b/core/src/trezor/workflow.py index 58f386e3ea..df7d0e97d8 100644 --- a/core/src/trezor/workflow.py +++ b/core/src/trezor/workflow.py @@ -1,7 +1,7 @@ from trezor import log, loop if False: - from typing import Callable, Optional, Set + from typing import Any, Callable, Optional, Set if __debug__: # Used in `on_close` bellow for memory statistics. @@ -75,7 +75,7 @@ def close_default() -> None: loop.close(default_task) -def _finalize_default(task, value) -> None: +def _finalize_default(task: loop.Task, value: Any) -> None: global default_task if default_task is task: diff --git a/python/src/trezorlib/messages/Address.py b/python/src/trezorlib/messages/Address.py index 4e8abf7943..c3daf3d85b 100644 --- a/python/src/trezorlib/messages/Address.py +++ b/python/src/trezorlib/messages/Address.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Address(p.MessageType): diff --git a/python/src/trezorlib/messages/ApplyFlags.py b/python/src/trezorlib/messages/ApplyFlags.py index b6f5bc614a..1cacb6ca89 100644 --- a/python/src/trezorlib/messages/ApplyFlags.py +++ b/python/src/trezorlib/messages/ApplyFlags.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ApplyFlags(p.MessageType): diff --git a/python/src/trezorlib/messages/ApplySettings.py b/python/src/trezorlib/messages/ApplySettings.py index 4e51d6b283..329a179f2a 100644 --- a/python/src/trezorlib/messages/ApplySettings.py +++ b/python/src/trezorlib/messages/ApplySettings.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypePassphraseSourceType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypePassphraseSourceType = None # type: ignore + pass class ApplySettings(p.MessageType): diff --git a/python/src/trezorlib/messages/BackupDevice.py b/python/src/trezorlib/messages/BackupDevice.py index f7a13b4f97..5464034ff8 100644 --- a/python/src/trezorlib/messages/BackupDevice.py +++ b/python/src/trezorlib/messages/BackupDevice.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BackupDevice(p.MessageType): diff --git a/python/src/trezorlib/messages/BackupType.py b/python/src/trezorlib/messages/BackupType.py index d9e6f6fc4a..7b3e30a6cd 100644 --- a/python/src/trezorlib/messages/BackupType.py +++ b/python/src/trezorlib/messages/BackupType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -Bip39 = 0 -Slip39_Basic = 1 -Slip39_Advanced = 2 +if False: + from typing_extensions import Literal + +Bip39 = 0 # type: Literal[0] +Slip39_Basic = 1 # type: Literal[1] +Slip39_Advanced = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/BinanceAddress.py b/python/src/trezorlib/messages/BinanceAddress.py index 727d2bfd05..9aa9ab1ab3 100644 --- a/python/src/trezorlib/messages/BinanceAddress.py +++ b/python/src/trezorlib/messages/BinanceAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceCancelMsg.py b/python/src/trezorlib/messages/BinanceCancelMsg.py index 72b9a570f7..121e6a64bf 100644 --- a/python/src/trezorlib/messages/BinanceCancelMsg.py +++ b/python/src/trezorlib/messages/BinanceCancelMsg.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceCancelMsg(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceCoin.py b/python/src/trezorlib/messages/BinanceCoin.py index c40fc848a4..d00c9e188d 100644 --- a/python/src/trezorlib/messages/BinanceCoin.py +++ b/python/src/trezorlib/messages/BinanceCoin.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceCoin(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceGetAddress.py b/python/src/trezorlib/messages/BinanceGetAddress.py index be51033c32..a61008c8fd 100644 --- a/python/src/trezorlib/messages/BinanceGetAddress.py +++ b/python/src/trezorlib/messages/BinanceGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceGetPublicKey.py b/python/src/trezorlib/messages/BinanceGetPublicKey.py index 574879f89d..1332d9dc6e 100644 --- a/python/src/trezorlib/messages/BinanceGetPublicKey.py +++ b/python/src/trezorlib/messages/BinanceGetPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceGetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceInputOutput.py b/python/src/trezorlib/messages/BinanceInputOutput.py index c9148b6b14..86fb7835b7 100644 --- a/python/src/trezorlib/messages/BinanceInputOutput.py +++ b/python/src/trezorlib/messages/BinanceInputOutput.py @@ -6,10 +6,10 @@ from .BinanceCoin import BinanceCoin if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceInputOutput(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceOrderMsg.py b/python/src/trezorlib/messages/BinanceOrderMsg.py index 81950477fe..d84de857e6 100644 --- a/python/src/trezorlib/messages/BinanceOrderMsg.py +++ b/python/src/trezorlib/messages/BinanceOrderMsg.py @@ -4,16 +4,13 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeBinanceOrderType = Literal[0, 1, 2, 3] EnumTypeBinanceOrderSide = Literal[0, 1, 2] EnumTypeBinanceTimeInForce = Literal[0, 1, 2, 3] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeBinanceOrderType = None # type: ignore - EnumTypeBinanceOrderSide = None # type: ignore - EnumTypeBinanceTimeInForce = None # type: ignore + pass class BinanceOrderMsg(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceOrderSide.py b/python/src/trezorlib/messages/BinanceOrderSide.py index 454fff0fe6..1105b9849e 100644 --- a/python/src/trezorlib/messages/BinanceOrderSide.py +++ b/python/src/trezorlib/messages/BinanceOrderSide.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -SIDE_UNKNOWN = 0 -BUY = 1 -SELL = 2 +if False: + from typing_extensions import Literal + +SIDE_UNKNOWN = 0 # type: Literal[0] +BUY = 1 # type: Literal[1] +SELL = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/BinanceOrderType.py b/python/src/trezorlib/messages/BinanceOrderType.py index 3349a5fdba..6bd753c46f 100644 --- a/python/src/trezorlib/messages/BinanceOrderType.py +++ b/python/src/trezorlib/messages/BinanceOrderType.py @@ -1,6 +1,9 @@ # Automatically generated by pb2py # fmt: off -OT_UNKNOWN = 0 -MARKET = 1 -LIMIT = 2 -OT_RESERVED = 3 +if False: + from typing_extensions import Literal + +OT_UNKNOWN = 0 # type: Literal[0] +MARKET = 1 # type: Literal[1] +LIMIT = 2 # type: Literal[2] +OT_RESERVED = 3 # type: Literal[3] diff --git a/python/src/trezorlib/messages/BinancePublicKey.py b/python/src/trezorlib/messages/BinancePublicKey.py index ad6ee462b0..5f453031be 100644 --- a/python/src/trezorlib/messages/BinancePublicKey.py +++ b/python/src/trezorlib/messages/BinancePublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinancePublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceSignTx.py b/python/src/trezorlib/messages/BinanceSignTx.py index 1738e85002..716cc7e126 100644 --- a/python/src/trezorlib/messages/BinanceSignTx.py +++ b/python/src/trezorlib/messages/BinanceSignTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceSignedTx.py b/python/src/trezorlib/messages/BinanceSignedTx.py index 00eeaea11c..a26b550dd8 100644 --- a/python/src/trezorlib/messages/BinanceSignedTx.py +++ b/python/src/trezorlib/messages/BinanceSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceTimeInForce.py b/python/src/trezorlib/messages/BinanceTimeInForce.py index fa6e5f4207..d3d596dd1f 100644 --- a/python/src/trezorlib/messages/BinanceTimeInForce.py +++ b/python/src/trezorlib/messages/BinanceTimeInForce.py @@ -1,6 +1,9 @@ # Automatically generated by pb2py # fmt: off -TIF_UNKNOWN = 0 -GTE = 1 -TIF_RESERVED = 2 -IOC = 3 +if False: + from typing_extensions import Literal + +TIF_UNKNOWN = 0 # type: Literal[0] +GTE = 1 # type: Literal[1] +TIF_RESERVED = 2 # type: Literal[2] +IOC = 3 # type: Literal[3] diff --git a/python/src/trezorlib/messages/BinanceTransferMsg.py b/python/src/trezorlib/messages/BinanceTransferMsg.py index c932b56d19..b3486bfdfc 100644 --- a/python/src/trezorlib/messages/BinanceTransferMsg.py +++ b/python/src/trezorlib/messages/BinanceTransferMsg.py @@ -6,10 +6,10 @@ from .BinanceInputOutput import BinanceInputOutput if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceTransferMsg(p.MessageType): diff --git a/python/src/trezorlib/messages/BinanceTxRequest.py b/python/src/trezorlib/messages/BinanceTxRequest.py index b9b7b69748..70da3a4a55 100644 --- a/python/src/trezorlib/messages/BinanceTxRequest.py +++ b/python/src/trezorlib/messages/BinanceTxRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class BinanceTxRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/ButtonAck.py b/python/src/trezorlib/messages/ButtonAck.py index db823052e5..48d50d8069 100644 --- a/python/src/trezorlib/messages/ButtonAck.py +++ b/python/src/trezorlib/messages/ButtonAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ButtonAck(p.MessageType): diff --git a/python/src/trezorlib/messages/ButtonRequest.py b/python/src/trezorlib/messages/ButtonRequest.py index 496ecc494c..2e23247c98 100644 --- a/python/src/trezorlib/messages/ButtonRequest.py +++ b/python/src/trezorlib/messages/ButtonRequest.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeButtonRequestType = None # type: ignore + pass class ButtonRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/ButtonRequestType.py b/python/src/trezorlib/messages/ButtonRequestType.py index 3206fa0af0..f29e98d1e4 100644 --- a/python/src/trezorlib/messages/ButtonRequestType.py +++ b/python/src/trezorlib/messages/ButtonRequestType.py @@ -1,20 +1,23 @@ # Automatically generated by pb2py # fmt: off -Other = 1 -FeeOverThreshold = 2 -ConfirmOutput = 3 -ResetDevice = 4 -ConfirmWord = 5 -WipeDevice = 6 -ProtectCall = 7 -SignTx = 8 -FirmwareCheck = 9 -Address = 10 -PublicKey = 11 -MnemonicWordCount = 12 -MnemonicInput = 13 -PassphraseType = 14 -UnknownDerivationPath = 15 -RecoveryHomepage = 16 -Success = 17 -Warning = 18 +if False: + from typing_extensions import Literal + +Other = 1 # type: Literal[1] +FeeOverThreshold = 2 # type: Literal[2] +ConfirmOutput = 3 # type: Literal[3] +ResetDevice = 4 # type: Literal[4] +ConfirmWord = 5 # type: Literal[5] +WipeDevice = 6 # type: Literal[6] +ProtectCall = 7 # type: Literal[7] +SignTx = 8 # type: Literal[8] +FirmwareCheck = 9 # type: Literal[9] +Address = 10 # type: Literal[10] +PublicKey = 11 # type: Literal[11] +MnemonicWordCount = 12 # type: Literal[12] +MnemonicInput = 13 # type: Literal[13] +PassphraseType = 14 # type: Literal[14] +UnknownDerivationPath = 15 # type: Literal[15] +RecoveryHomepage = 16 # type: Literal[16] +Success = 17 # type: Literal[17] +Warning = 18 # type: Literal[18] diff --git a/python/src/trezorlib/messages/Cancel.py b/python/src/trezorlib/messages/Cancel.py index d8c2d99194..22ea2b9009 100644 --- a/python/src/trezorlib/messages/Cancel.py +++ b/python/src/trezorlib/messages/Cancel.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Cancel(p.MessageType): diff --git a/python/src/trezorlib/messages/Capability.py b/python/src/trezorlib/messages/Capability.py index 5f8069198c..4a4f6d93f9 100644 --- a/python/src/trezorlib/messages/Capability.py +++ b/python/src/trezorlib/messages/Capability.py @@ -1,18 +1,21 @@ # Automatically generated by pb2py # fmt: off -Bitcoin = 1 -Bitcoin_like = 2 -Binance = 3 -Cardano = 4 -Crypto = 5 -EOS = 6 -Ethereum = 7 -Lisk = 8 -Monero = 9 -NEM = 10 -Ripple = 11 -Stellar = 12 -Tezos = 13 -U2F = 14 -Shamir = 15 -ShamirGroups = 16 +if False: + from typing_extensions import Literal + +Bitcoin = 1 # type: Literal[1] +Bitcoin_like = 2 # type: Literal[2] +Binance = 3 # type: Literal[3] +Cardano = 4 # type: Literal[4] +Crypto = 5 # type: Literal[5] +EOS = 6 # type: Literal[6] +Ethereum = 7 # type: Literal[7] +Lisk = 8 # type: Literal[8] +Monero = 9 # type: Literal[9] +NEM = 10 # type: Literal[10] +Ripple = 11 # type: Literal[11] +Stellar = 12 # type: Literal[12] +Tezos = 13 # type: Literal[13] +U2F = 14 # type: Literal[14] +Shamir = 15 # type: Literal[15] +ShamirGroups = 16 # type: Literal[16] diff --git a/python/src/trezorlib/messages/CardanoAddress.py b/python/src/trezorlib/messages/CardanoAddress.py index c0e46006a0..ede61f1909 100644 --- a/python/src/trezorlib/messages/CardanoAddress.py +++ b/python/src/trezorlib/messages/CardanoAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoGetAddress.py b/python/src/trezorlib/messages/CardanoGetAddress.py index 0c383f4c8a..546c9cfa37 100644 --- a/python/src/trezorlib/messages/CardanoGetAddress.py +++ b/python/src/trezorlib/messages/CardanoGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoGetPublicKey.py b/python/src/trezorlib/messages/CardanoGetPublicKey.py index b8bcc43268..3c9386ffaf 100644 --- a/python/src/trezorlib/messages/CardanoGetPublicKey.py +++ b/python/src/trezorlib/messages/CardanoGetPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoGetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoPublicKey.py b/python/src/trezorlib/messages/CardanoPublicKey.py index 9e66438315..401a2bba78 100644 --- a/python/src/trezorlib/messages/CardanoPublicKey.py +++ b/python/src/trezorlib/messages/CardanoPublicKey.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoSignTx.py b/python/src/trezorlib/messages/CardanoSignTx.py index a6e99ec4b8..b2758e06d6 100644 --- a/python/src/trezorlib/messages/CardanoSignTx.py +++ b/python/src/trezorlib/messages/CardanoSignTx.py @@ -7,10 +7,10 @@ from .CardanoTxOutputType import CardanoTxOutputType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoSignedTx.py b/python/src/trezorlib/messages/CardanoSignedTx.py index 17734a546e..c9da421309 100644 --- a/python/src/trezorlib/messages/CardanoSignedTx.py +++ b/python/src/trezorlib/messages/CardanoSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoTxAck.py b/python/src/trezorlib/messages/CardanoTxAck.py index f96f80c5fa..5b07e9e08f 100644 --- a/python/src/trezorlib/messages/CardanoTxAck.py +++ b/python/src/trezorlib/messages/CardanoTxAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxAck(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoTxInputType.py b/python/src/trezorlib/messages/CardanoTxInputType.py index 20f14d26ae..ce2ccdb2c0 100644 --- a/python/src/trezorlib/messages/CardanoTxInputType.py +++ b/python/src/trezorlib/messages/CardanoTxInputType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxInputType(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoTxOutputType.py b/python/src/trezorlib/messages/CardanoTxOutputType.py index def6586378..ead6d3cc78 100644 --- a/python/src/trezorlib/messages/CardanoTxOutputType.py +++ b/python/src/trezorlib/messages/CardanoTxOutputType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxOutputType(p.MessageType): diff --git a/python/src/trezorlib/messages/CardanoTxRequest.py b/python/src/trezorlib/messages/CardanoTxRequest.py index 09adf95bca..57b48b8753 100644 --- a/python/src/trezorlib/messages/CardanoTxRequest.py +++ b/python/src/trezorlib/messages/CardanoTxRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CardanoTxRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/ChangePin.py b/python/src/trezorlib/messages/ChangePin.py index 87f3cd0464..cc3b776a35 100644 --- a/python/src/trezorlib/messages/ChangePin.py +++ b/python/src/trezorlib/messages/ChangePin.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ChangePin(p.MessageType): diff --git a/python/src/trezorlib/messages/CipherKeyValue.py b/python/src/trezorlib/messages/CipherKeyValue.py index fb33434cd8..fc028e9a23 100644 --- a/python/src/trezorlib/messages/CipherKeyValue.py +++ b/python/src/trezorlib/messages/CipherKeyValue.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CipherKeyValue(p.MessageType): diff --git a/python/src/trezorlib/messages/CipheredKeyValue.py b/python/src/trezorlib/messages/CipheredKeyValue.py index ca7a3bc828..43fd811073 100644 --- a/python/src/trezorlib/messages/CipheredKeyValue.py +++ b/python/src/trezorlib/messages/CipheredKeyValue.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CipheredKeyValue(p.MessageType): diff --git a/python/src/trezorlib/messages/ClearSession.py b/python/src/trezorlib/messages/ClearSession.py index defc7e6371..48e2d36aaf 100644 --- a/python/src/trezorlib/messages/ClearSession.py +++ b/python/src/trezorlib/messages/ClearSession.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ClearSession(p.MessageType): diff --git a/python/src/trezorlib/messages/CosiCommit.py b/python/src/trezorlib/messages/CosiCommit.py index b122b21da2..f75bb84dbf 100644 --- a/python/src/trezorlib/messages/CosiCommit.py +++ b/python/src/trezorlib/messages/CosiCommit.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CosiCommit(p.MessageType): diff --git a/python/src/trezorlib/messages/CosiCommitment.py b/python/src/trezorlib/messages/CosiCommitment.py index d1bf4d17a3..57bf00a801 100644 --- a/python/src/trezorlib/messages/CosiCommitment.py +++ b/python/src/trezorlib/messages/CosiCommitment.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CosiCommitment(p.MessageType): diff --git a/python/src/trezorlib/messages/CosiSign.py b/python/src/trezorlib/messages/CosiSign.py index ef0c956a00..56950193b2 100644 --- a/python/src/trezorlib/messages/CosiSign.py +++ b/python/src/trezorlib/messages/CosiSign.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CosiSign(p.MessageType): diff --git a/python/src/trezorlib/messages/CosiSignature.py b/python/src/trezorlib/messages/CosiSignature.py index 71e9cf7b18..1d73730646 100644 --- a/python/src/trezorlib/messages/CosiSignature.py +++ b/python/src/trezorlib/messages/CosiSignature.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class CosiSignature(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkDecision.py b/python/src/trezorlib/messages/DebugLinkDecision.py index bd3e1a5e7d..177c0dc579 100644 --- a/python/src/trezorlib/messages/DebugLinkDecision.py +++ b/python/src/trezorlib/messages/DebugLinkDecision.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeDebugSwipeDirection = Literal[0, 1, 2, 3] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeDebugSwipeDirection = None # type: ignore + pass class DebugLinkDecision(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkFlashErase.py b/python/src/trezorlib/messages/DebugLinkFlashErase.py index f65f0a7ffa..dea9ec10a6 100644 --- a/python/src/trezorlib/messages/DebugLinkFlashErase.py +++ b/python/src/trezorlib/messages/DebugLinkFlashErase.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkFlashErase(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkGetState.py b/python/src/trezorlib/messages/DebugLinkGetState.py index f6a1114b2c..d84d2ddc69 100644 --- a/python/src/trezorlib/messages/DebugLinkGetState.py +++ b/python/src/trezorlib/messages/DebugLinkGetState.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkGetState(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkLog.py b/python/src/trezorlib/messages/DebugLinkLog.py index 279d4630a1..bbf58ae9d0 100644 --- a/python/src/trezorlib/messages/DebugLinkLog.py +++ b/python/src/trezorlib/messages/DebugLinkLog.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkLog(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkMemory.py b/python/src/trezorlib/messages/DebugLinkMemory.py index f7167de9de..72412409ff 100644 --- a/python/src/trezorlib/messages/DebugLinkMemory.py +++ b/python/src/trezorlib/messages/DebugLinkMemory.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkMemory(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkMemoryRead.py b/python/src/trezorlib/messages/DebugLinkMemoryRead.py index da02de1a56..1181c0c190 100644 --- a/python/src/trezorlib/messages/DebugLinkMemoryRead.py +++ b/python/src/trezorlib/messages/DebugLinkMemoryRead.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkMemoryRead(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkMemoryWrite.py b/python/src/trezorlib/messages/DebugLinkMemoryWrite.py index e6f212e0dd..12dca69e4e 100644 --- a/python/src/trezorlib/messages/DebugLinkMemoryWrite.py +++ b/python/src/trezorlib/messages/DebugLinkMemoryWrite.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkMemoryWrite(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkState.py b/python/src/trezorlib/messages/DebugLinkState.py index f1135b3d83..bce8b84b49 100644 --- a/python/src/trezorlib/messages/DebugLinkState.py +++ b/python/src/trezorlib/messages/DebugLinkState.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkState(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugLinkStop.py b/python/src/trezorlib/messages/DebugLinkStop.py index e4c478b78d..3910038e1d 100644 --- a/python/src/trezorlib/messages/DebugLinkStop.py +++ b/python/src/trezorlib/messages/DebugLinkStop.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugLinkStop(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugMoneroDiagAck.py b/python/src/trezorlib/messages/DebugMoneroDiagAck.py index 7b9065f0da..6f6a24abe5 100644 --- a/python/src/trezorlib/messages/DebugMoneroDiagAck.py +++ b/python/src/trezorlib/messages/DebugMoneroDiagAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugMoneroDiagAck(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugMoneroDiagRequest.py b/python/src/trezorlib/messages/DebugMoneroDiagRequest.py index 8651671fad..fa7d1e121f 100644 --- a/python/src/trezorlib/messages/DebugMoneroDiagRequest.py +++ b/python/src/trezorlib/messages/DebugMoneroDiagRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class DebugMoneroDiagRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/DebugSwipeDirection.py b/python/src/trezorlib/messages/DebugSwipeDirection.py index 23d6f9f998..b53ccc7ff2 100644 --- a/python/src/trezorlib/messages/DebugSwipeDirection.py +++ b/python/src/trezorlib/messages/DebugSwipeDirection.py @@ -1,6 +1,9 @@ # Automatically generated by pb2py # fmt: off -UP = 0 -DOWN = 1 -LEFT = 2 -RIGHT = 3 +if False: + from typing_extensions import Literal + +UP = 0 # type: Literal[0] +DOWN = 1 # type: Literal[1] +LEFT = 2 # type: Literal[2] +RIGHT = 3 # type: Literal[3] diff --git a/python/src/trezorlib/messages/ECDHSessionKey.py b/python/src/trezorlib/messages/ECDHSessionKey.py index dd0a60c943..6b6af39484 100644 --- a/python/src/trezorlib/messages/ECDHSessionKey.py +++ b/python/src/trezorlib/messages/ECDHSessionKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class ECDHSessionKey(p.MessageType): diff --git a/python/src/trezorlib/messages/Entropy.py b/python/src/trezorlib/messages/Entropy.py index 777080fad1..cb4f351f89 100644 --- a/python/src/trezorlib/messages/Entropy.py +++ b/python/src/trezorlib/messages/Entropy.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Entropy(p.MessageType): diff --git a/python/src/trezorlib/messages/EntropyAck.py b/python/src/trezorlib/messages/EntropyAck.py index 6824ee7da3..760e70e411 100644 --- a/python/src/trezorlib/messages/EntropyAck.py +++ b/python/src/trezorlib/messages/EntropyAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EntropyAck(p.MessageType): diff --git a/python/src/trezorlib/messages/EntropyRequest.py b/python/src/trezorlib/messages/EntropyRequest.py index d0c7e1260d..c747354488 100644 --- a/python/src/trezorlib/messages/EntropyRequest.py +++ b/python/src/trezorlib/messages/EntropyRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EntropyRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionBuyRam.py b/python/src/trezorlib/messages/EosActionBuyRam.py index cc9ae62fd0..112f434780 100644 --- a/python/src/trezorlib/messages/EosActionBuyRam.py +++ b/python/src/trezorlib/messages/EosActionBuyRam.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionBuyRam(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionBuyRamBytes.py b/python/src/trezorlib/messages/EosActionBuyRamBytes.py index 374ed3bd5a..55f06967ce 100644 --- a/python/src/trezorlib/messages/EosActionBuyRamBytes.py +++ b/python/src/trezorlib/messages/EosActionBuyRamBytes.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionBuyRamBytes(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionCommon.py b/python/src/trezorlib/messages/EosActionCommon.py index 76c0e6ff38..1da11051e4 100644 --- a/python/src/trezorlib/messages/EosActionCommon.py +++ b/python/src/trezorlib/messages/EosActionCommon.py @@ -6,10 +6,10 @@ from .EosPermissionLevel import EosPermissionLevel if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionCommon(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionDelegate.py b/python/src/trezorlib/messages/EosActionDelegate.py index 5afe71e782..70eb4b4ca3 100644 --- a/python/src/trezorlib/messages/EosActionDelegate.py +++ b/python/src/trezorlib/messages/EosActionDelegate.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionDelegate(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionDeleteAuth.py b/python/src/trezorlib/messages/EosActionDeleteAuth.py index 17a2677de7..6d9c7f1ccd 100644 --- a/python/src/trezorlib/messages/EosActionDeleteAuth.py +++ b/python/src/trezorlib/messages/EosActionDeleteAuth.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionDeleteAuth(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionLinkAuth.py b/python/src/trezorlib/messages/EosActionLinkAuth.py index 57f81b2e19..65cf616011 100644 --- a/python/src/trezorlib/messages/EosActionLinkAuth.py +++ b/python/src/trezorlib/messages/EosActionLinkAuth.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionLinkAuth(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionNewAccount.py b/python/src/trezorlib/messages/EosActionNewAccount.py index 55677a900e..5300727c23 100644 --- a/python/src/trezorlib/messages/EosActionNewAccount.py +++ b/python/src/trezorlib/messages/EosActionNewAccount.py @@ -6,10 +6,10 @@ from .EosAuthorization import EosAuthorization if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionNewAccount(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionRefund.py b/python/src/trezorlib/messages/EosActionRefund.py index a98eb7f6cb..3ff89f1122 100644 --- a/python/src/trezorlib/messages/EosActionRefund.py +++ b/python/src/trezorlib/messages/EosActionRefund.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionRefund(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionSellRam.py b/python/src/trezorlib/messages/EosActionSellRam.py index 51fe851c13..4809538dfe 100644 --- a/python/src/trezorlib/messages/EosActionSellRam.py +++ b/python/src/trezorlib/messages/EosActionSellRam.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionSellRam(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionTransfer.py b/python/src/trezorlib/messages/EosActionTransfer.py index a30d7b994c..f9c4977cac 100644 --- a/python/src/trezorlib/messages/EosActionTransfer.py +++ b/python/src/trezorlib/messages/EosActionTransfer.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionTransfer(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionUndelegate.py b/python/src/trezorlib/messages/EosActionUndelegate.py index d1f814916e..946944f708 100644 --- a/python/src/trezorlib/messages/EosActionUndelegate.py +++ b/python/src/trezorlib/messages/EosActionUndelegate.py @@ -6,10 +6,10 @@ from .EosAsset import EosAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUndelegate(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionUnknown.py b/python/src/trezorlib/messages/EosActionUnknown.py index 0d42d2f51f..6b1227d625 100644 --- a/python/src/trezorlib/messages/EosActionUnknown.py +++ b/python/src/trezorlib/messages/EosActionUnknown.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUnknown(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionUnlinkAuth.py b/python/src/trezorlib/messages/EosActionUnlinkAuth.py index 3137ccd3b8..c48bda7b9f 100644 --- a/python/src/trezorlib/messages/EosActionUnlinkAuth.py +++ b/python/src/trezorlib/messages/EosActionUnlinkAuth.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUnlinkAuth(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionUpdateAuth.py b/python/src/trezorlib/messages/EosActionUpdateAuth.py index 67c33a6b56..b0f023776d 100644 --- a/python/src/trezorlib/messages/EosActionUpdateAuth.py +++ b/python/src/trezorlib/messages/EosActionUpdateAuth.py @@ -6,10 +6,10 @@ from .EosAuthorization import EosAuthorization if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionUpdateAuth(p.MessageType): diff --git a/python/src/trezorlib/messages/EosActionVoteProducer.py b/python/src/trezorlib/messages/EosActionVoteProducer.py index 7b27395913..c630e54d13 100644 --- a/python/src/trezorlib/messages/EosActionVoteProducer.py +++ b/python/src/trezorlib/messages/EosActionVoteProducer.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosActionVoteProducer(p.MessageType): diff --git a/python/src/trezorlib/messages/EosAsset.py b/python/src/trezorlib/messages/EosAsset.py index dcd540a091..d0ef5f8178 100644 --- a/python/src/trezorlib/messages/EosAsset.py +++ b/python/src/trezorlib/messages/EosAsset.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAsset(p.MessageType): diff --git a/python/src/trezorlib/messages/EosAuthorization.py b/python/src/trezorlib/messages/EosAuthorization.py index 3890103908..c448a2cb63 100644 --- a/python/src/trezorlib/messages/EosAuthorization.py +++ b/python/src/trezorlib/messages/EosAuthorization.py @@ -8,10 +8,10 @@ from .EosAuthorizationWait import EosAuthorizationWait if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorization(p.MessageType): diff --git a/python/src/trezorlib/messages/EosAuthorizationAccount.py b/python/src/trezorlib/messages/EosAuthorizationAccount.py index 3984856e05..0d3a986e41 100644 --- a/python/src/trezorlib/messages/EosAuthorizationAccount.py +++ b/python/src/trezorlib/messages/EosAuthorizationAccount.py @@ -6,10 +6,10 @@ from .EosPermissionLevel import EosPermissionLevel if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorizationAccount(p.MessageType): diff --git a/python/src/trezorlib/messages/EosAuthorizationKey.py b/python/src/trezorlib/messages/EosAuthorizationKey.py index c5ba1f5d4c..8894d6e5ea 100644 --- a/python/src/trezorlib/messages/EosAuthorizationKey.py +++ b/python/src/trezorlib/messages/EosAuthorizationKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorizationKey(p.MessageType): diff --git a/python/src/trezorlib/messages/EosAuthorizationWait.py b/python/src/trezorlib/messages/EosAuthorizationWait.py index cf48e2bd18..000dbe1480 100644 --- a/python/src/trezorlib/messages/EosAuthorizationWait.py +++ b/python/src/trezorlib/messages/EosAuthorizationWait.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosAuthorizationWait(p.MessageType): diff --git a/python/src/trezorlib/messages/EosGetPublicKey.py b/python/src/trezorlib/messages/EosGetPublicKey.py index 674e5c5e51..19a6f66e40 100644 --- a/python/src/trezorlib/messages/EosGetPublicKey.py +++ b/python/src/trezorlib/messages/EosGetPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosGetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/EosPermissionLevel.py b/python/src/trezorlib/messages/EosPermissionLevel.py index 7a566cc3c5..f2bcd23ad5 100644 --- a/python/src/trezorlib/messages/EosPermissionLevel.py +++ b/python/src/trezorlib/messages/EosPermissionLevel.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosPermissionLevel(p.MessageType): diff --git a/python/src/trezorlib/messages/EosPublicKey.py b/python/src/trezorlib/messages/EosPublicKey.py index 0b0eed18c0..6ad41cd97d 100644 --- a/python/src/trezorlib/messages/EosPublicKey.py +++ b/python/src/trezorlib/messages/EosPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/EosSignTx.py b/python/src/trezorlib/messages/EosSignTx.py index cec4745131..02b17701ea 100644 --- a/python/src/trezorlib/messages/EosSignTx.py +++ b/python/src/trezorlib/messages/EosSignTx.py @@ -6,10 +6,10 @@ from .EosTxHeader import EosTxHeader if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/EosSignedTx.py b/python/src/trezorlib/messages/EosSignedTx.py index 63bb0081c0..626f871580 100644 --- a/python/src/trezorlib/messages/EosSignedTx.py +++ b/python/src/trezorlib/messages/EosSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/EosTxActionAck.py b/python/src/trezorlib/messages/EosTxActionAck.py index e4a6be9364..b9625ffc01 100644 --- a/python/src/trezorlib/messages/EosTxActionAck.py +++ b/python/src/trezorlib/messages/EosTxActionAck.py @@ -20,10 +20,10 @@ from .EosActionVoteProducer import EosActionVoteProducer if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosTxActionAck(p.MessageType): diff --git a/python/src/trezorlib/messages/EosTxActionRequest.py b/python/src/trezorlib/messages/EosTxActionRequest.py index 57872110e4..636b91ddc8 100644 --- a/python/src/trezorlib/messages/EosTxActionRequest.py +++ b/python/src/trezorlib/messages/EosTxActionRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosTxActionRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/EosTxHeader.py b/python/src/trezorlib/messages/EosTxHeader.py index e5e5c22ed3..3db777bc18 100644 --- a/python/src/trezorlib/messages/EosTxHeader.py +++ b/python/src/trezorlib/messages/EosTxHeader.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EosTxHeader(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumAddress.py b/python/src/trezorlib/messages/EthereumAddress.py index 280a2369df..c692de3f5d 100644 --- a/python/src/trezorlib/messages/EthereumAddress.py +++ b/python/src/trezorlib/messages/EthereumAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumGetAddress.py b/python/src/trezorlib/messages/EthereumGetAddress.py index 686c4b89f3..9e8a084481 100644 --- a/python/src/trezorlib/messages/EthereumGetAddress.py +++ b/python/src/trezorlib/messages/EthereumGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumGetPublicKey.py b/python/src/trezorlib/messages/EthereumGetPublicKey.py index ca18dbef16..950987d4b7 100644 --- a/python/src/trezorlib/messages/EthereumGetPublicKey.py +++ b/python/src/trezorlib/messages/EthereumGetPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumGetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumMessageSignature.py b/python/src/trezorlib/messages/EthereumMessageSignature.py index 1078621789..2ce3b6756a 100644 --- a/python/src/trezorlib/messages/EthereumMessageSignature.py +++ b/python/src/trezorlib/messages/EthereumMessageSignature.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumMessageSignature(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumPublicKey.py b/python/src/trezorlib/messages/EthereumPublicKey.py index af531678d7..a6f01c0a64 100644 --- a/python/src/trezorlib/messages/EthereumPublicKey.py +++ b/python/src/trezorlib/messages/EthereumPublicKey.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumSignMessage.py b/python/src/trezorlib/messages/EthereumSignMessage.py index 000166b9bd..2f85584ffc 100644 --- a/python/src/trezorlib/messages/EthereumSignMessage.py +++ b/python/src/trezorlib/messages/EthereumSignMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumSignMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumSignTx.py b/python/src/trezorlib/messages/EthereumSignTx.py index 710406ca10..848e2dfffb 100644 --- a/python/src/trezorlib/messages/EthereumSignTx.py +++ b/python/src/trezorlib/messages/EthereumSignTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumTxAck.py b/python/src/trezorlib/messages/EthereumTxAck.py index aacb878e6e..8e6e4313bf 100644 --- a/python/src/trezorlib/messages/EthereumTxAck.py +++ b/python/src/trezorlib/messages/EthereumTxAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumTxAck(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumTxRequest.py b/python/src/trezorlib/messages/EthereumTxRequest.py index 6f9d266bf1..e2f494241a 100644 --- a/python/src/trezorlib/messages/EthereumTxRequest.py +++ b/python/src/trezorlib/messages/EthereumTxRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumTxRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/EthereumVerifyMessage.py b/python/src/trezorlib/messages/EthereumVerifyMessage.py index 41b8c7d9f9..2104f44dda 100644 --- a/python/src/trezorlib/messages/EthereumVerifyMessage.py +++ b/python/src/trezorlib/messages/EthereumVerifyMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class EthereumVerifyMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/Failure.py b/python/src/trezorlib/messages/Failure.py index 5c7bb8bd67..6157cffa04 100644 --- a/python/src/trezorlib/messages/Failure.py +++ b/python/src/trezorlib/messages/Failure.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeFailureType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 99] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeFailureType = None # type: ignore + pass class Failure(p.MessageType): diff --git a/python/src/trezorlib/messages/FailureType.py b/python/src/trezorlib/messages/FailureType.py index 6f5cffe184..1e5c8b6e74 100644 --- a/python/src/trezorlib/messages/FailureType.py +++ b/python/src/trezorlib/messages/FailureType.py @@ -1,15 +1,18 @@ # Automatically generated by pb2py # fmt: off -UnexpectedMessage = 1 -ButtonExpected = 2 -DataError = 3 -ActionCancelled = 4 -PinExpected = 5 -PinCancelled = 6 -PinInvalid = 7 -InvalidSignature = 8 -ProcessError = 9 -NotEnoughFunds = 10 -NotInitialized = 11 -PinMismatch = 12 -FirmwareError = 99 +if False: + from typing_extensions import Literal + +UnexpectedMessage = 1 # type: Literal[1] +ButtonExpected = 2 # type: Literal[2] +DataError = 3 # type: Literal[3] +ActionCancelled = 4 # type: Literal[4] +PinExpected = 5 # type: Literal[5] +PinCancelled = 6 # type: Literal[6] +PinInvalid = 7 # type: Literal[7] +InvalidSignature = 8 # type: Literal[8] +ProcessError = 9 # type: Literal[9] +NotEnoughFunds = 10 # type: Literal[10] +NotInitialized = 11 # type: Literal[11] +PinMismatch = 12 # type: Literal[12] +FirmwareError = 99 # type: Literal[99] diff --git a/python/src/trezorlib/messages/Features.py b/python/src/trezorlib/messages/Features.py index b21c39dfc6..4e355e50ef 100644 --- a/python/src/trezorlib/messages/Features.py +++ b/python/src/trezorlib/messages/Features.py @@ -4,14 +4,12 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] EnumTypeBackupType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeCapability = None # type: ignore - EnumTypeBackupType = None # type: ignore + pass class Features(p.MessageType): diff --git a/python/src/trezorlib/messages/FirmwareErase.py b/python/src/trezorlib/messages/FirmwareErase.py index 1f0fef92e1..4658f2b461 100644 --- a/python/src/trezorlib/messages/FirmwareErase.py +++ b/python/src/trezorlib/messages/FirmwareErase.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class FirmwareErase(p.MessageType): diff --git a/python/src/trezorlib/messages/FirmwareRequest.py b/python/src/trezorlib/messages/FirmwareRequest.py index a1809ba357..ffa6ecb4f0 100644 --- a/python/src/trezorlib/messages/FirmwareRequest.py +++ b/python/src/trezorlib/messages/FirmwareRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class FirmwareRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/FirmwareUpload.py b/python/src/trezorlib/messages/FirmwareUpload.py index 1a1af861fd..06041a063c 100644 --- a/python/src/trezorlib/messages/FirmwareUpload.py +++ b/python/src/trezorlib/messages/FirmwareUpload.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class FirmwareUpload(p.MessageType): diff --git a/python/src/trezorlib/messages/GetAddress.py b/python/src/trezorlib/messages/GetAddress.py index 1f677a6134..4bfcc0ebcc 100644 --- a/python/src/trezorlib/messages/GetAddress.py +++ b/python/src/trezorlib/messages/GetAddress.py @@ -6,12 +6,11 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class GetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/GetECDHSessionKey.py b/python/src/trezorlib/messages/GetECDHSessionKey.py index 592dc37877..12e56b04cb 100644 --- a/python/src/trezorlib/messages/GetECDHSessionKey.py +++ b/python/src/trezorlib/messages/GetECDHSessionKey.py @@ -6,10 +6,10 @@ from .IdentityType import IdentityType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class GetECDHSessionKey(p.MessageType): diff --git a/python/src/trezorlib/messages/GetEntropy.py b/python/src/trezorlib/messages/GetEntropy.py index 25bd1f1263..835a98cd3c 100644 --- a/python/src/trezorlib/messages/GetEntropy.py +++ b/python/src/trezorlib/messages/GetEntropy.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class GetEntropy(p.MessageType): diff --git a/python/src/trezorlib/messages/GetFeatures.py b/python/src/trezorlib/messages/GetFeatures.py index d7eca5c3d6..5b6a9dc067 100644 --- a/python/src/trezorlib/messages/GetFeatures.py +++ b/python/src/trezorlib/messages/GetFeatures.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class GetFeatures(p.MessageType): diff --git a/python/src/trezorlib/messages/GetPublicKey.py b/python/src/trezorlib/messages/GetPublicKey.py index 08db2d0995..02bbfa5295 100644 --- a/python/src/trezorlib/messages/GetPublicKey.py +++ b/python/src/trezorlib/messages/GetPublicKey.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class GetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/HDNodePathType.py b/python/src/trezorlib/messages/HDNodePathType.py index d776fbb0a6..8636be9718 100644 --- a/python/src/trezorlib/messages/HDNodePathType.py +++ b/python/src/trezorlib/messages/HDNodePathType.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class HDNodePathType(p.MessageType): diff --git a/python/src/trezorlib/messages/HDNodeType.py b/python/src/trezorlib/messages/HDNodeType.py index 87c73d6e58..d0e14c0d9a 100644 --- a/python/src/trezorlib/messages/HDNodeType.py +++ b/python/src/trezorlib/messages/HDNodeType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class HDNodeType(p.MessageType): diff --git a/python/src/trezorlib/messages/IdentityType.py b/python/src/trezorlib/messages/IdentityType.py index ad65df0cd7..bf6b28f1a3 100644 --- a/python/src/trezorlib/messages/IdentityType.py +++ b/python/src/trezorlib/messages/IdentityType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class IdentityType(p.MessageType): diff --git a/python/src/trezorlib/messages/Initialize.py b/python/src/trezorlib/messages/Initialize.py index b594136cf6..dacf75889a 100644 --- a/python/src/trezorlib/messages/Initialize.py +++ b/python/src/trezorlib/messages/Initialize.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Initialize(p.MessageType): diff --git a/python/src/trezorlib/messages/InputScriptType.py b/python/src/trezorlib/messages/InputScriptType.py index 09b8332cbe..fc2223e251 100644 --- a/python/src/trezorlib/messages/InputScriptType.py +++ b/python/src/trezorlib/messages/InputScriptType.py @@ -1,7 +1,10 @@ # Automatically generated by pb2py # fmt: off -SPENDADDRESS = 0 -SPENDMULTISIG = 1 -EXTERNAL = 2 -SPENDWITNESS = 3 -SPENDP2SHWITNESS = 4 +if False: + from typing_extensions import Literal + +SPENDADDRESS = 0 # type: Literal[0] +SPENDMULTISIG = 1 # type: Literal[1] +EXTERNAL = 2 # type: Literal[2] +SPENDWITNESS = 3 # type: Literal[3] +SPENDP2SHWITNESS = 4 # type: Literal[4] diff --git a/python/src/trezorlib/messages/LiskAddress.py b/python/src/trezorlib/messages/LiskAddress.py index 3e732bf343..6501f24022 100644 --- a/python/src/trezorlib/messages/LiskAddress.py +++ b/python/src/trezorlib/messages/LiskAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskDelegateType.py b/python/src/trezorlib/messages/LiskDelegateType.py index b268d40184..a5b5320db5 100644 --- a/python/src/trezorlib/messages/LiskDelegateType.py +++ b/python/src/trezorlib/messages/LiskDelegateType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskDelegateType(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskGetAddress.py b/python/src/trezorlib/messages/LiskGetAddress.py index f5d1422fbc..c233a0e5e8 100644 --- a/python/src/trezorlib/messages/LiskGetAddress.py +++ b/python/src/trezorlib/messages/LiskGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskGetPublicKey.py b/python/src/trezorlib/messages/LiskGetPublicKey.py index a32dbd0592..d360e43da0 100644 --- a/python/src/trezorlib/messages/LiskGetPublicKey.py +++ b/python/src/trezorlib/messages/LiskGetPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskGetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskMessageSignature.py b/python/src/trezorlib/messages/LiskMessageSignature.py index 010fb5d4dc..d0657ccebe 100644 --- a/python/src/trezorlib/messages/LiskMessageSignature.py +++ b/python/src/trezorlib/messages/LiskMessageSignature.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskMessageSignature(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskMultisignatureType.py b/python/src/trezorlib/messages/LiskMultisignatureType.py index 9063ecc2e1..17e32c22de 100644 --- a/python/src/trezorlib/messages/LiskMultisignatureType.py +++ b/python/src/trezorlib/messages/LiskMultisignatureType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskMultisignatureType(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskPublicKey.py b/python/src/trezorlib/messages/LiskPublicKey.py index 4db38d42a9..15e972654a 100644 --- a/python/src/trezorlib/messages/LiskPublicKey.py +++ b/python/src/trezorlib/messages/LiskPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskSignMessage.py b/python/src/trezorlib/messages/LiskSignMessage.py index 1adfc3b5a6..55c325bc31 100644 --- a/python/src/trezorlib/messages/LiskSignMessage.py +++ b/python/src/trezorlib/messages/LiskSignMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskSignTx.py b/python/src/trezorlib/messages/LiskSignTx.py index 9c121059c1..8ed8d654de 100644 --- a/python/src/trezorlib/messages/LiskSignTx.py +++ b/python/src/trezorlib/messages/LiskSignTx.py @@ -6,10 +6,10 @@ from .LiskTransactionCommon import LiskTransactionCommon if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskSignatureType.py b/python/src/trezorlib/messages/LiskSignatureType.py index 22142302cf..26f7a6a744 100644 --- a/python/src/trezorlib/messages/LiskSignatureType.py +++ b/python/src/trezorlib/messages/LiskSignatureType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignatureType(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskSignedTx.py b/python/src/trezorlib/messages/LiskSignedTx.py index ec3e5eb747..f7c5cabb97 100644 --- a/python/src/trezorlib/messages/LiskSignedTx.py +++ b/python/src/trezorlib/messages/LiskSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskTransactionAsset.py b/python/src/trezorlib/messages/LiskTransactionAsset.py index 138b8e6994..886f1b0770 100644 --- a/python/src/trezorlib/messages/LiskTransactionAsset.py +++ b/python/src/trezorlib/messages/LiskTransactionAsset.py @@ -8,10 +8,10 @@ from .LiskSignatureType import LiskSignatureType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskTransactionAsset(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskTransactionCommon.py b/python/src/trezorlib/messages/LiskTransactionCommon.py index 04ff4aae45..6b27a2d29f 100644 --- a/python/src/trezorlib/messages/LiskTransactionCommon.py +++ b/python/src/trezorlib/messages/LiskTransactionCommon.py @@ -6,12 +6,11 @@ from .LiskTransactionAsset import LiskTransactionAsset if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeLiskTransactionType = Literal[0, 1, 2, 3, 4, 5, 6, 7] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeLiskTransactionType = None # type: ignore + pass class LiskTransactionCommon(p.MessageType): diff --git a/python/src/trezorlib/messages/LiskTransactionType.py b/python/src/trezorlib/messages/LiskTransactionType.py index 04847eed76..79069c6a94 100644 --- a/python/src/trezorlib/messages/LiskTransactionType.py +++ b/python/src/trezorlib/messages/LiskTransactionType.py @@ -1,10 +1,13 @@ # Automatically generated by pb2py # fmt: off -Transfer = 0 -RegisterSecondPassphrase = 1 -RegisterDelegate = 2 -CastVotes = 3 -RegisterMultisignatureAccount = 4 -CreateDapp = 5 -TransferIntoDapp = 6 -TransferOutOfDapp = 7 +if False: + from typing_extensions import Literal + +Transfer = 0 # type: Literal[0] +RegisterSecondPassphrase = 1 # type: Literal[1] +RegisterDelegate = 2 # type: Literal[2] +CastVotes = 3 # type: Literal[3] +RegisterMultisignatureAccount = 4 # type: Literal[4] +CreateDapp = 5 # type: Literal[5] +TransferIntoDapp = 6 # type: Literal[6] +TransferOutOfDapp = 7 # type: Literal[7] diff --git a/python/src/trezorlib/messages/LiskVerifyMessage.py b/python/src/trezorlib/messages/LiskVerifyMessage.py index 1eb62c865e..0b87f214a6 100644 --- a/python/src/trezorlib/messages/LiskVerifyMessage.py +++ b/python/src/trezorlib/messages/LiskVerifyMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LiskVerifyMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/LoadDevice.py b/python/src/trezorlib/messages/LoadDevice.py index 263ab2b9bb..23966bda44 100644 --- a/python/src/trezorlib/messages/LoadDevice.py +++ b/python/src/trezorlib/messages/LoadDevice.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class LoadDevice(p.MessageType): diff --git a/python/src/trezorlib/messages/MessageSignature.py b/python/src/trezorlib/messages/MessageSignature.py index 1ba7e6f1a1..912817016b 100644 --- a/python/src/trezorlib/messages/MessageSignature.py +++ b/python/src/trezorlib/messages/MessageSignature.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MessageSignature(p.MessageType): diff --git a/python/src/trezorlib/messages/MessageType.py b/python/src/trezorlib/messages/MessageType.py index 75f0ccfe67..39ca8b2ff3 100644 --- a/python/src/trezorlib/messages/MessageType.py +++ b/python/src/trezorlib/messages/MessageType.py @@ -1,184 +1,187 @@ # Automatically generated by pb2py # fmt: off -Initialize = 0 -Ping = 1 -Success = 2 -Failure = 3 -ChangePin = 4 -WipeDevice = 5 -GetEntropy = 9 -Entropy = 10 -LoadDevice = 13 -ResetDevice = 14 -Features = 17 -PinMatrixRequest = 18 -PinMatrixAck = 19 -Cancel = 20 -ClearSession = 24 -ApplySettings = 25 -ButtonRequest = 26 -ButtonAck = 27 -ApplyFlags = 28 -BackupDevice = 34 -EntropyRequest = 35 -EntropyAck = 36 -PassphraseRequest = 41 -PassphraseAck = 42 -PassphraseStateRequest = 77 -PassphraseStateAck = 78 -RecoveryDevice = 45 -WordRequest = 46 -WordAck = 47 -GetFeatures = 55 -SetU2FCounter = 63 -SdProtect = 79 -FirmwareErase = 6 -FirmwareUpload = 7 -FirmwareRequest = 8 -SelfTest = 32 -GetPublicKey = 11 -PublicKey = 12 -SignTx = 15 -TxRequest = 21 -TxAck = 22 -GetAddress = 29 -Address = 30 -SignMessage = 38 -VerifyMessage = 39 -MessageSignature = 40 -CipherKeyValue = 23 -CipheredKeyValue = 48 -SignIdentity = 53 -SignedIdentity = 54 -GetECDHSessionKey = 61 -ECDHSessionKey = 62 -CosiCommit = 71 -CosiCommitment = 72 -CosiSign = 73 -CosiSignature = 74 -DebugLinkDecision = 100 -DebugLinkGetState = 101 -DebugLinkState = 102 -DebugLinkStop = 103 -DebugLinkLog = 104 -DebugLinkMemoryRead = 110 -DebugLinkMemory = 111 -DebugLinkMemoryWrite = 112 -DebugLinkFlashErase = 113 -EthereumGetPublicKey = 450 -EthereumPublicKey = 451 -EthereumGetAddress = 56 -EthereumAddress = 57 -EthereumSignTx = 58 -EthereumTxRequest = 59 -EthereumTxAck = 60 -EthereumSignMessage = 64 -EthereumVerifyMessage = 65 -EthereumMessageSignature = 66 -NEMGetAddress = 67 -NEMAddress = 68 -NEMSignTx = 69 -NEMSignedTx = 70 -NEMDecryptMessage = 75 -NEMDecryptedMessage = 76 -LiskGetAddress = 114 -LiskAddress = 115 -LiskSignTx = 116 -LiskSignedTx = 117 -LiskSignMessage = 118 -LiskMessageSignature = 119 -LiskVerifyMessage = 120 -LiskGetPublicKey = 121 -LiskPublicKey = 122 -TezosGetAddress = 150 -TezosAddress = 151 -TezosSignTx = 152 -TezosSignedTx = 153 -TezosGetPublicKey = 154 -TezosPublicKey = 155 -StellarSignTx = 202 -StellarTxOpRequest = 203 -StellarGetAddress = 207 -StellarAddress = 208 -StellarCreateAccountOp = 210 -StellarPaymentOp = 211 -StellarPathPaymentOp = 212 -StellarManageOfferOp = 213 -StellarCreatePassiveOfferOp = 214 -StellarSetOptionsOp = 215 -StellarChangeTrustOp = 216 -StellarAllowTrustOp = 217 -StellarAccountMergeOp = 218 -StellarManageDataOp = 220 -StellarBumpSequenceOp = 221 -StellarSignedTx = 230 -CardanoSignTx = 303 -CardanoTxRequest = 304 -CardanoGetPublicKey = 305 -CardanoPublicKey = 306 -CardanoGetAddress = 307 -CardanoAddress = 308 -CardanoTxAck = 309 -CardanoSignedTx = 310 -RippleGetAddress = 400 -RippleAddress = 401 -RippleSignTx = 402 -RippleSignedTx = 403 -MoneroTransactionInitRequest = 501 -MoneroTransactionInitAck = 502 -MoneroTransactionSetInputRequest = 503 -MoneroTransactionSetInputAck = 504 -MoneroTransactionInputsPermutationRequest = 505 -MoneroTransactionInputsPermutationAck = 506 -MoneroTransactionInputViniRequest = 507 -MoneroTransactionInputViniAck = 508 -MoneroTransactionAllInputsSetRequest = 509 -MoneroTransactionAllInputsSetAck = 510 -MoneroTransactionSetOutputRequest = 511 -MoneroTransactionSetOutputAck = 512 -MoneroTransactionAllOutSetRequest = 513 -MoneroTransactionAllOutSetAck = 514 -MoneroTransactionSignInputRequest = 515 -MoneroTransactionSignInputAck = 516 -MoneroTransactionFinalRequest = 517 -MoneroTransactionFinalAck = 518 -MoneroKeyImageExportInitRequest = 530 -MoneroKeyImageExportInitAck = 531 -MoneroKeyImageSyncStepRequest = 532 -MoneroKeyImageSyncStepAck = 533 -MoneroKeyImageSyncFinalRequest = 534 -MoneroKeyImageSyncFinalAck = 535 -MoneroGetAddress = 540 -MoneroAddress = 541 -MoneroGetWatchKey = 542 -MoneroWatchKey = 543 -DebugMoneroDiagRequest = 546 -DebugMoneroDiagAck = 547 -MoneroGetTxKeyRequest = 550 -MoneroGetTxKeyAck = 551 -MoneroLiveRefreshStartRequest = 552 -MoneroLiveRefreshStartAck = 553 -MoneroLiveRefreshStepRequest = 554 -MoneroLiveRefreshStepAck = 555 -MoneroLiveRefreshFinalRequest = 556 -MoneroLiveRefreshFinalAck = 557 -EosGetPublicKey = 600 -EosPublicKey = 601 -EosSignTx = 602 -EosTxActionRequest = 603 -EosTxActionAck = 604 -EosSignedTx = 605 -BinanceGetAddress = 700 -BinanceAddress = 701 -BinanceGetPublicKey = 702 -BinancePublicKey = 703 -BinanceSignTx = 704 -BinanceTxRequest = 705 -BinanceTransferMsg = 706 -BinanceOrderMsg = 707 -BinanceCancelMsg = 708 -BinanceSignedTx = 709 -WebAuthnListResidentCredentials = 800 -WebAuthnCredentials = 801 -WebAuthnAddResidentCredential = 802 -WebAuthnRemoveResidentCredential = 803 +if False: + from typing_extensions import Literal + +Initialize = 0 # type: Literal[0] +Ping = 1 # type: Literal[1] +Success = 2 # type: Literal[2] +Failure = 3 # type: Literal[3] +ChangePin = 4 # type: Literal[4] +WipeDevice = 5 # type: Literal[5] +GetEntropy = 9 # type: Literal[9] +Entropy = 10 # type: Literal[10] +LoadDevice = 13 # type: Literal[13] +ResetDevice = 14 # type: Literal[14] +Features = 17 # type: Literal[17] +PinMatrixRequest = 18 # type: Literal[18] +PinMatrixAck = 19 # type: Literal[19] +Cancel = 20 # type: Literal[20] +ClearSession = 24 # type: Literal[24] +ApplySettings = 25 # type: Literal[25] +ButtonRequest = 26 # type: Literal[26] +ButtonAck = 27 # type: Literal[27] +ApplyFlags = 28 # type: Literal[28] +BackupDevice = 34 # type: Literal[34] +EntropyRequest = 35 # type: Literal[35] +EntropyAck = 36 # type: Literal[36] +PassphraseRequest = 41 # type: Literal[41] +PassphraseAck = 42 # type: Literal[42] +PassphraseStateRequest = 77 # type: Literal[77] +PassphraseStateAck = 78 # type: Literal[78] +RecoveryDevice = 45 # type: Literal[45] +WordRequest = 46 # type: Literal[46] +WordAck = 47 # type: Literal[47] +GetFeatures = 55 # type: Literal[55] +SetU2FCounter = 63 # type: Literal[63] +SdProtect = 79 # type: Literal[79] +FirmwareErase = 6 # type: Literal[6] +FirmwareUpload = 7 # type: Literal[7] +FirmwareRequest = 8 # type: Literal[8] +SelfTest = 32 # type: Literal[32] +GetPublicKey = 11 # type: Literal[11] +PublicKey = 12 # type: Literal[12] +SignTx = 15 # type: Literal[15] +TxRequest = 21 # type: Literal[21] +TxAck = 22 # type: Literal[22] +GetAddress = 29 # type: Literal[29] +Address = 30 # type: Literal[30] +SignMessage = 38 # type: Literal[38] +VerifyMessage = 39 # type: Literal[39] +MessageSignature = 40 # type: Literal[40] +CipherKeyValue = 23 # type: Literal[23] +CipheredKeyValue = 48 # type: Literal[48] +SignIdentity = 53 # type: Literal[53] +SignedIdentity = 54 # type: Literal[54] +GetECDHSessionKey = 61 # type: Literal[61] +ECDHSessionKey = 62 # type: Literal[62] +CosiCommit = 71 # type: Literal[71] +CosiCommitment = 72 # type: Literal[72] +CosiSign = 73 # type: Literal[73] +CosiSignature = 74 # type: Literal[74] +DebugLinkDecision = 100 # type: Literal[100] +DebugLinkGetState = 101 # type: Literal[101] +DebugLinkState = 102 # type: Literal[102] +DebugLinkStop = 103 # type: Literal[103] +DebugLinkLog = 104 # type: Literal[104] +DebugLinkMemoryRead = 110 # type: Literal[110] +DebugLinkMemory = 111 # type: Literal[111] +DebugLinkMemoryWrite = 112 # type: Literal[112] +DebugLinkFlashErase = 113 # type: Literal[113] +EthereumGetPublicKey = 450 # type: Literal[450] +EthereumPublicKey = 451 # type: Literal[451] +EthereumGetAddress = 56 # type: Literal[56] +EthereumAddress = 57 # type: Literal[57] +EthereumSignTx = 58 # type: Literal[58] +EthereumTxRequest = 59 # type: Literal[59] +EthereumTxAck = 60 # type: Literal[60] +EthereumSignMessage = 64 # type: Literal[64] +EthereumVerifyMessage = 65 # type: Literal[65] +EthereumMessageSignature = 66 # type: Literal[66] +NEMGetAddress = 67 # type: Literal[67] +NEMAddress = 68 # type: Literal[68] +NEMSignTx = 69 # type: Literal[69] +NEMSignedTx = 70 # type: Literal[70] +NEMDecryptMessage = 75 # type: Literal[75] +NEMDecryptedMessage = 76 # type: Literal[76] +LiskGetAddress = 114 # type: Literal[114] +LiskAddress = 115 # type: Literal[115] +LiskSignTx = 116 # type: Literal[116] +LiskSignedTx = 117 # type: Literal[117] +LiskSignMessage = 118 # type: Literal[118] +LiskMessageSignature = 119 # type: Literal[119] +LiskVerifyMessage = 120 # type: Literal[120] +LiskGetPublicKey = 121 # type: Literal[121] +LiskPublicKey = 122 # type: Literal[122] +TezosGetAddress = 150 # type: Literal[150] +TezosAddress = 151 # type: Literal[151] +TezosSignTx = 152 # type: Literal[152] +TezosSignedTx = 153 # type: Literal[153] +TezosGetPublicKey = 154 # type: Literal[154] +TezosPublicKey = 155 # type: Literal[155] +StellarSignTx = 202 # type: Literal[202] +StellarTxOpRequest = 203 # type: Literal[203] +StellarGetAddress = 207 # type: Literal[207] +StellarAddress = 208 # type: Literal[208] +StellarCreateAccountOp = 210 # type: Literal[210] +StellarPaymentOp = 211 # type: Literal[211] +StellarPathPaymentOp = 212 # type: Literal[212] +StellarManageOfferOp = 213 # type: Literal[213] +StellarCreatePassiveOfferOp = 214 # type: Literal[214] +StellarSetOptionsOp = 215 # type: Literal[215] +StellarChangeTrustOp = 216 # type: Literal[216] +StellarAllowTrustOp = 217 # type: Literal[217] +StellarAccountMergeOp = 218 # type: Literal[218] +StellarManageDataOp = 220 # type: Literal[220] +StellarBumpSequenceOp = 221 # type: Literal[221] +StellarSignedTx = 230 # type: Literal[230] +CardanoSignTx = 303 # type: Literal[303] +CardanoTxRequest = 304 # type: Literal[304] +CardanoGetPublicKey = 305 # type: Literal[305] +CardanoPublicKey = 306 # type: Literal[306] +CardanoGetAddress = 307 # type: Literal[307] +CardanoAddress = 308 # type: Literal[308] +CardanoTxAck = 309 # type: Literal[309] +CardanoSignedTx = 310 # type: Literal[310] +RippleGetAddress = 400 # type: Literal[400] +RippleAddress = 401 # type: Literal[401] +RippleSignTx = 402 # type: Literal[402] +RippleSignedTx = 403 # type: Literal[403] +MoneroTransactionInitRequest = 501 # type: Literal[501] +MoneroTransactionInitAck = 502 # type: Literal[502] +MoneroTransactionSetInputRequest = 503 # type: Literal[503] +MoneroTransactionSetInputAck = 504 # type: Literal[504] +MoneroTransactionInputsPermutationRequest = 505 # type: Literal[505] +MoneroTransactionInputsPermutationAck = 506 # type: Literal[506] +MoneroTransactionInputViniRequest = 507 # type: Literal[507] +MoneroTransactionInputViniAck = 508 # type: Literal[508] +MoneroTransactionAllInputsSetRequest = 509 # type: Literal[509] +MoneroTransactionAllInputsSetAck = 510 # type: Literal[510] +MoneroTransactionSetOutputRequest = 511 # type: Literal[511] +MoneroTransactionSetOutputAck = 512 # type: Literal[512] +MoneroTransactionAllOutSetRequest = 513 # type: Literal[513] +MoneroTransactionAllOutSetAck = 514 # type: Literal[514] +MoneroTransactionSignInputRequest = 515 # type: Literal[515] +MoneroTransactionSignInputAck = 516 # type: Literal[516] +MoneroTransactionFinalRequest = 517 # type: Literal[517] +MoneroTransactionFinalAck = 518 # type: Literal[518] +MoneroKeyImageExportInitRequest = 530 # type: Literal[530] +MoneroKeyImageExportInitAck = 531 # type: Literal[531] +MoneroKeyImageSyncStepRequest = 532 # type: Literal[532] +MoneroKeyImageSyncStepAck = 533 # type: Literal[533] +MoneroKeyImageSyncFinalRequest = 534 # type: Literal[534] +MoneroKeyImageSyncFinalAck = 535 # type: Literal[535] +MoneroGetAddress = 540 # type: Literal[540] +MoneroAddress = 541 # type: Literal[541] +MoneroGetWatchKey = 542 # type: Literal[542] +MoneroWatchKey = 543 # type: Literal[543] +DebugMoneroDiagRequest = 546 # type: Literal[546] +DebugMoneroDiagAck = 547 # type: Literal[547] +MoneroGetTxKeyRequest = 550 # type: Literal[550] +MoneroGetTxKeyAck = 551 # type: Literal[551] +MoneroLiveRefreshStartRequest = 552 # type: Literal[552] +MoneroLiveRefreshStartAck = 553 # type: Literal[553] +MoneroLiveRefreshStepRequest = 554 # type: Literal[554] +MoneroLiveRefreshStepAck = 555 # type: Literal[555] +MoneroLiveRefreshFinalRequest = 556 # type: Literal[556] +MoneroLiveRefreshFinalAck = 557 # type: Literal[557] +EosGetPublicKey = 600 # type: Literal[600] +EosPublicKey = 601 # type: Literal[601] +EosSignTx = 602 # type: Literal[602] +EosTxActionRequest = 603 # type: Literal[603] +EosTxActionAck = 604 # type: Literal[604] +EosSignedTx = 605 # type: Literal[605] +BinanceGetAddress = 700 # type: Literal[700] +BinanceAddress = 701 # type: Literal[701] +BinanceGetPublicKey = 702 # type: Literal[702] +BinancePublicKey = 703 # type: Literal[703] +BinanceSignTx = 704 # type: Literal[704] +BinanceTxRequest = 705 # type: Literal[705] +BinanceTransferMsg = 706 # type: Literal[706] +BinanceOrderMsg = 707 # type: Literal[707] +BinanceCancelMsg = 708 # type: Literal[708] +BinanceSignedTx = 709 # type: Literal[709] +WebAuthnListResidentCredentials = 800 # type: Literal[800] +WebAuthnCredentials = 801 # type: Literal[801] +WebAuthnAddResidentCredential = 802 # type: Literal[802] +WebAuthnRemoveResidentCredential = 803 # type: Literal[803] diff --git a/python/src/trezorlib/messages/MoneroAccountPublicAddress.py b/python/src/trezorlib/messages/MoneroAccountPublicAddress.py index 9eefba4b7b..1a4c5ef628 100644 --- a/python/src/trezorlib/messages/MoneroAccountPublicAddress.py +++ b/python/src/trezorlib/messages/MoneroAccountPublicAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroAccountPublicAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroAddress.py b/python/src/trezorlib/messages/MoneroAddress.py index 385b5150b0..3e0d6e46ea 100644 --- a/python/src/trezorlib/messages/MoneroAddress.py +++ b/python/src/trezorlib/messages/MoneroAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroExportedKeyImage.py b/python/src/trezorlib/messages/MoneroExportedKeyImage.py index 69d2871aef..9d8707f499 100644 --- a/python/src/trezorlib/messages/MoneroExportedKeyImage.py +++ b/python/src/trezorlib/messages/MoneroExportedKeyImage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroExportedKeyImage(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroGetAddress.py b/python/src/trezorlib/messages/MoneroGetAddress.py index 5433217347..229a3c8658 100644 --- a/python/src/trezorlib/messages/MoneroGetAddress.py +++ b/python/src/trezorlib/messages/MoneroGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroGetTxKeyAck.py b/python/src/trezorlib/messages/MoneroGetTxKeyAck.py index 4e58a881ff..04aa63a97e 100644 --- a/python/src/trezorlib/messages/MoneroGetTxKeyAck.py +++ b/python/src/trezorlib/messages/MoneroGetTxKeyAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetTxKeyAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroGetTxKeyRequest.py b/python/src/trezorlib/messages/MoneroGetTxKeyRequest.py index 728fa4e081..b935838df9 100644 --- a/python/src/trezorlib/messages/MoneroGetTxKeyRequest.py +++ b/python/src/trezorlib/messages/MoneroGetTxKeyRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetTxKeyRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroGetWatchKey.py b/python/src/trezorlib/messages/MoneroGetWatchKey.py index df97e5e292..4042391fe5 100644 --- a/python/src/trezorlib/messages/MoneroGetWatchKey.py +++ b/python/src/trezorlib/messages/MoneroGetWatchKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroGetWatchKey(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroKeyImageExportInitAck.py b/python/src/trezorlib/messages/MoneroKeyImageExportInitAck.py index 97d99769cd..1e08d8a162 100644 --- a/python/src/trezorlib/messages/MoneroKeyImageExportInitAck.py +++ b/python/src/trezorlib/messages/MoneroKeyImageExportInitAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageExportInitAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroKeyImageExportInitRequest.py b/python/src/trezorlib/messages/MoneroKeyImageExportInitRequest.py index fd374a27f3..a7b5e93c13 100644 --- a/python/src/trezorlib/messages/MoneroKeyImageExportInitRequest.py +++ b/python/src/trezorlib/messages/MoneroKeyImageExportInitRequest.py @@ -6,10 +6,10 @@ from .MoneroSubAddressIndicesList import MoneroSubAddressIndicesList if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageExportInitRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py b/python/src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py index 32497cf1eb..e6ff1ccf0f 100644 --- a/python/src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py +++ b/python/src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncFinalAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.py b/python/src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.py index 063a385495..d3b770f53a 100644 --- a/python/src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.py +++ b/python/src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncFinalRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroKeyImageSyncStepAck.py b/python/src/trezorlib/messages/MoneroKeyImageSyncStepAck.py index 0bd2f5fd65..50dd33ff78 100644 --- a/python/src/trezorlib/messages/MoneroKeyImageSyncStepAck.py +++ b/python/src/trezorlib/messages/MoneroKeyImageSyncStepAck.py @@ -6,10 +6,10 @@ from .MoneroExportedKeyImage import MoneroExportedKeyImage if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncStepAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py b/python/src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py index 5674bae3af..a865ba53a7 100644 --- a/python/src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py +++ b/python/src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py @@ -6,10 +6,10 @@ from .MoneroTransferDetails import MoneroTransferDetails if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroKeyImageSyncStepRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroLiveRefreshFinalAck.py b/python/src/trezorlib/messages/MoneroLiveRefreshFinalAck.py index 33c0c19eab..dc4fdfd3f7 100644 --- a/python/src/trezorlib/messages/MoneroLiveRefreshFinalAck.py +++ b/python/src/trezorlib/messages/MoneroLiveRefreshFinalAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshFinalAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroLiveRefreshFinalRequest.py b/python/src/trezorlib/messages/MoneroLiveRefreshFinalRequest.py index 0e496f370d..14af01e7ac 100644 --- a/python/src/trezorlib/messages/MoneroLiveRefreshFinalRequest.py +++ b/python/src/trezorlib/messages/MoneroLiveRefreshFinalRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshFinalRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroLiveRefreshStartAck.py b/python/src/trezorlib/messages/MoneroLiveRefreshStartAck.py index c85acbdfde..9784b79d0b 100644 --- a/python/src/trezorlib/messages/MoneroLiveRefreshStartAck.py +++ b/python/src/trezorlib/messages/MoneroLiveRefreshStartAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStartAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroLiveRefreshStartRequest.py b/python/src/trezorlib/messages/MoneroLiveRefreshStartRequest.py index 40f09d1fb9..0eb390c55b 100644 --- a/python/src/trezorlib/messages/MoneroLiveRefreshStartRequest.py +++ b/python/src/trezorlib/messages/MoneroLiveRefreshStartRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStartRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroLiveRefreshStepAck.py b/python/src/trezorlib/messages/MoneroLiveRefreshStepAck.py index 90e756e93c..13e2b501f7 100644 --- a/python/src/trezorlib/messages/MoneroLiveRefreshStepAck.py +++ b/python/src/trezorlib/messages/MoneroLiveRefreshStepAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStepAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroLiveRefreshStepRequest.py b/python/src/trezorlib/messages/MoneroLiveRefreshStepRequest.py index 56615376c6..06049441a3 100644 --- a/python/src/trezorlib/messages/MoneroLiveRefreshStepRequest.py +++ b/python/src/trezorlib/messages/MoneroLiveRefreshStepRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroLiveRefreshStepRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroMultisigKLRki.py b/python/src/trezorlib/messages/MoneroMultisigKLRki.py index 2b338c4425..c7adbf5d63 100644 --- a/python/src/trezorlib/messages/MoneroMultisigKLRki.py +++ b/python/src/trezorlib/messages/MoneroMultisigKLRki.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroMultisigKLRki(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroOutputEntry.py b/python/src/trezorlib/messages/MoneroOutputEntry.py index 005070e1dd..f24eb77969 100644 --- a/python/src/trezorlib/messages/MoneroOutputEntry.py +++ b/python/src/trezorlib/messages/MoneroOutputEntry.py @@ -6,10 +6,10 @@ from .MoneroRctKeyPublic import MoneroRctKeyPublic if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroOutputEntry(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroRctKeyPublic.py b/python/src/trezorlib/messages/MoneroRctKeyPublic.py index 5c313fb6f1..250a97a2db 100644 --- a/python/src/trezorlib/messages/MoneroRctKeyPublic.py +++ b/python/src/trezorlib/messages/MoneroRctKeyPublic.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroRctKeyPublic(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroRingCtSig.py b/python/src/trezorlib/messages/MoneroRingCtSig.py index 7a08a5d40c..051134d13f 100644 --- a/python/src/trezorlib/messages/MoneroRingCtSig.py +++ b/python/src/trezorlib/messages/MoneroRingCtSig.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroRingCtSig(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroSubAddressIndicesList.py b/python/src/trezorlib/messages/MoneroSubAddressIndicesList.py index 8ea8f4a690..c74cea6426 100644 --- a/python/src/trezorlib/messages/MoneroSubAddressIndicesList.py +++ b/python/src/trezorlib/messages/MoneroSubAddressIndicesList.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroSubAddressIndicesList(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py b/python/src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py index b7e2b2e8c0..33ac79184b 100644 --- a/python/src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllInputsSetAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.py b/python/src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.py index 4e80f35d3b..b1ddaec604 100644 --- a/python/src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllInputsSetRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionAllOutSetAck.py b/python/src/trezorlib/messages/MoneroTransactionAllOutSetAck.py index acf372fed3..d16063b218 100644 --- a/python/src/trezorlib/messages/MoneroTransactionAllOutSetAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionAllOutSetAck.py @@ -6,10 +6,10 @@ from .MoneroRingCtSig import MoneroRingCtSig if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllOutSetAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py b/python/src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py index 6f89636283..b6bf2393ae 100644 --- a/python/src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionAllOutSetRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionData.py b/python/src/trezorlib/messages/MoneroTransactionData.py index f9d95bbf63..d46c2294d1 100644 --- a/python/src/trezorlib/messages/MoneroTransactionData.py +++ b/python/src/trezorlib/messages/MoneroTransactionData.py @@ -7,10 +7,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionData(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionDestinationEntry.py b/python/src/trezorlib/messages/MoneroTransactionDestinationEntry.py index c9d520e291..18bee8a7d9 100644 --- a/python/src/trezorlib/messages/MoneroTransactionDestinationEntry.py +++ b/python/src/trezorlib/messages/MoneroTransactionDestinationEntry.py @@ -6,10 +6,10 @@ from .MoneroAccountPublicAddress import MoneroAccountPublicAddress if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionDestinationEntry(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionFinalAck.py b/python/src/trezorlib/messages/MoneroTransactionFinalAck.py index 9d5068d01e..169bed0ec3 100644 --- a/python/src/trezorlib/messages/MoneroTransactionFinalAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionFinalAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionFinalAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionFinalRequest.py b/python/src/trezorlib/messages/MoneroTransactionFinalRequest.py index 79ba3834a5..92f1a72aee 100644 --- a/python/src/trezorlib/messages/MoneroTransactionFinalRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionFinalRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionFinalRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionInitAck.py b/python/src/trezorlib/messages/MoneroTransactionInitAck.py index f6c2930552..b4f44ff504 100644 --- a/python/src/trezorlib/messages/MoneroTransactionInitAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionInitAck.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInitAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionInitRequest.py b/python/src/trezorlib/messages/MoneroTransactionInitRequest.py index 922790fc09..f3d202babb 100644 --- a/python/src/trezorlib/messages/MoneroTransactionInitRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionInitRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionData import MoneroTransactionData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInitRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionInputViniAck.py b/python/src/trezorlib/messages/MoneroTransactionInputViniAck.py index af549e94c1..c9a23ee8c4 100644 --- a/python/src/trezorlib/messages/MoneroTransactionInputViniAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionInputViniAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputViniAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionInputViniRequest.py b/python/src/trezorlib/messages/MoneroTransactionInputViniRequest.py index 86e5233a7f..fea73bfe75 100644 --- a/python/src/trezorlib/messages/MoneroTransactionInputViniRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionInputViniRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputViniRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionInputsPermutationAck.py b/python/src/trezorlib/messages/MoneroTransactionInputsPermutationAck.py index 729aa09a00..ec57692148 100644 --- a/python/src/trezorlib/messages/MoneroTransactionInputsPermutationAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionInputsPermutationAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputsPermutationAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py b/python/src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py index 323d61fe4b..86e23b3454 100644 --- a/python/src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionInputsPermutationRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionRsigData.py b/python/src/trezorlib/messages/MoneroTransactionRsigData.py index 27dc5e03fa..924bb8c9d5 100644 --- a/python/src/trezorlib/messages/MoneroTransactionRsigData.py +++ b/python/src/trezorlib/messages/MoneroTransactionRsigData.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionRsigData(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSetInputAck.py b/python/src/trezorlib/messages/MoneroTransactionSetInputAck.py index 4216e69503..4c42f94703 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSetInputAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionSetInputAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetInputAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSetInputRequest.py b/python/src/trezorlib/messages/MoneroTransactionSetInputRequest.py index 963586ee8c..c1e8fd411f 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSetInputRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionSetInputRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetInputRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSetOutputAck.py b/python/src/trezorlib/messages/MoneroTransactionSetOutputAck.py index 7616759a6e..b533986410 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSetOutputAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionSetOutputAck.py @@ -6,10 +6,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetOutputAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSetOutputRequest.py b/python/src/trezorlib/messages/MoneroTransactionSetOutputRequest.py index 3113cda412..6c4a671cea 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSetOutputRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionSetOutputRequest.py @@ -7,10 +7,10 @@ from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSetOutputRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSignInputAck.py b/python/src/trezorlib/messages/MoneroTransactionSignInputAck.py index 0727f557db..61da74be09 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSignInputAck.py +++ b/python/src/trezorlib/messages/MoneroTransactionSignInputAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSignInputAck(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSignInputRequest.py b/python/src/trezorlib/messages/MoneroTransactionSignInputRequest.py index 19304f3451..81a204a56f 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSignInputRequest.py +++ b/python/src/trezorlib/messages/MoneroTransactionSignInputRequest.py @@ -6,10 +6,10 @@ from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSignInputRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransactionSourceEntry.py b/python/src/trezorlib/messages/MoneroTransactionSourceEntry.py index a315b399a6..8da1203e32 100644 --- a/python/src/trezorlib/messages/MoneroTransactionSourceEntry.py +++ b/python/src/trezorlib/messages/MoneroTransactionSourceEntry.py @@ -7,10 +7,10 @@ from .MoneroOutputEntry import MoneroOutputEntry if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransactionSourceEntry(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroTransferDetails.py b/python/src/trezorlib/messages/MoneroTransferDetails.py index 7000757766..7adab6e5e7 100644 --- a/python/src/trezorlib/messages/MoneroTransferDetails.py +++ b/python/src/trezorlib/messages/MoneroTransferDetails.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroTransferDetails(p.MessageType): diff --git a/python/src/trezorlib/messages/MoneroWatchKey.py b/python/src/trezorlib/messages/MoneroWatchKey.py index 7defbc3fa9..4695cdb814 100644 --- a/python/src/trezorlib/messages/MoneroWatchKey.py +++ b/python/src/trezorlib/messages/MoneroWatchKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MoneroWatchKey(p.MessageType): diff --git a/python/src/trezorlib/messages/MultisigRedeemScriptType.py b/python/src/trezorlib/messages/MultisigRedeemScriptType.py index 08f1594dfd..c4558b1597 100644 --- a/python/src/trezorlib/messages/MultisigRedeemScriptType.py +++ b/python/src/trezorlib/messages/MultisigRedeemScriptType.py @@ -7,10 +7,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class MultisigRedeemScriptType(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMAddress.py b/python/src/trezorlib/messages/NEMAddress.py index 65dd69b60f..9c1831d02b 100644 --- a/python/src/trezorlib/messages/NEMAddress.py +++ b/python/src/trezorlib/messages/NEMAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMAggregateModification.py b/python/src/trezorlib/messages/NEMAggregateModification.py index cb6a6730b6..604c2cf6a0 100644 --- a/python/src/trezorlib/messages/NEMAggregateModification.py +++ b/python/src/trezorlib/messages/NEMAggregateModification.py @@ -6,10 +6,10 @@ from .NEMCosignatoryModification import NEMCosignatoryModification if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMAggregateModification(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMCosignatoryModification.py b/python/src/trezorlib/messages/NEMCosignatoryModification.py index b733c48224..855bf32512 100644 --- a/python/src/trezorlib/messages/NEMCosignatoryModification.py +++ b/python/src/trezorlib/messages/NEMCosignatoryModification.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMModificationType = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMModificationType = None # type: ignore + pass class NEMCosignatoryModification(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMDecryptMessage.py b/python/src/trezorlib/messages/NEMDecryptMessage.py index 11c301a556..70e5c3889f 100644 --- a/python/src/trezorlib/messages/NEMDecryptMessage.py +++ b/python/src/trezorlib/messages/NEMDecryptMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMDecryptMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMDecryptedMessage.py b/python/src/trezorlib/messages/NEMDecryptedMessage.py index ff59dba4a1..5647aef175 100644 --- a/python/src/trezorlib/messages/NEMDecryptedMessage.py +++ b/python/src/trezorlib/messages/NEMDecryptedMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMDecryptedMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMGetAddress.py b/python/src/trezorlib/messages/NEMGetAddress.py index 252e2b136a..61a699b84f 100644 --- a/python/src/trezorlib/messages/NEMGetAddress.py +++ b/python/src/trezorlib/messages/NEMGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMImportanceTransfer.py b/python/src/trezorlib/messages/NEMImportanceTransfer.py index 341c281778..e0c1627c33 100644 --- a/python/src/trezorlib/messages/NEMImportanceTransfer.py +++ b/python/src/trezorlib/messages/NEMImportanceTransfer.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMImportanceTransferMode = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMImportanceTransferMode = None # type: ignore + pass class NEMImportanceTransfer(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMImportanceTransferMode.py b/python/src/trezorlib/messages/NEMImportanceTransferMode.py index 912e27eb57..408c471844 100644 --- a/python/src/trezorlib/messages/NEMImportanceTransferMode.py +++ b/python/src/trezorlib/messages/NEMImportanceTransferMode.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -ImportanceTransfer_Activate = 1 -ImportanceTransfer_Deactivate = 2 +if False: + from typing_extensions import Literal + +ImportanceTransfer_Activate = 1 # type: Literal[1] +ImportanceTransfer_Deactivate = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/NEMModificationType.py b/python/src/trezorlib/messages/NEMModificationType.py index ee0f0ad70d..d33d2ca4da 100644 --- a/python/src/trezorlib/messages/NEMModificationType.py +++ b/python/src/trezorlib/messages/NEMModificationType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -CosignatoryModification_Add = 1 -CosignatoryModification_Delete = 2 +if False: + from typing_extensions import Literal + +CosignatoryModification_Add = 1 # type: Literal[1] +CosignatoryModification_Delete = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/NEMMosaic.py b/python/src/trezorlib/messages/NEMMosaic.py index 998d8d0268..2864cc3557 100644 --- a/python/src/trezorlib/messages/NEMMosaic.py +++ b/python/src/trezorlib/messages/NEMMosaic.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMMosaic(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMMosaicCreation.py b/python/src/trezorlib/messages/NEMMosaicCreation.py index fd0498ce7f..cbbe3c4e5e 100644 --- a/python/src/trezorlib/messages/NEMMosaicCreation.py +++ b/python/src/trezorlib/messages/NEMMosaicCreation.py @@ -6,10 +6,10 @@ from .NEMMosaicDefinition import NEMMosaicDefinition if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMMosaicCreation(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMMosaicDefinition.py b/python/src/trezorlib/messages/NEMMosaicDefinition.py index f55f9a35e4..375c0cef10 100644 --- a/python/src/trezorlib/messages/NEMMosaicDefinition.py +++ b/python/src/trezorlib/messages/NEMMosaicDefinition.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMMosaicLevy = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMMosaicLevy = None # type: ignore + pass class NEMMosaicDefinition(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMMosaicLevy.py b/python/src/trezorlib/messages/NEMMosaicLevy.py index bf896c1024..f5a7345790 100644 --- a/python/src/trezorlib/messages/NEMMosaicLevy.py +++ b/python/src/trezorlib/messages/NEMMosaicLevy.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -MosaicLevy_Absolute = 1 -MosaicLevy_Percentile = 2 +if False: + from typing_extensions import Literal + +MosaicLevy_Absolute = 1 # type: Literal[1] +MosaicLevy_Percentile = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/NEMMosaicSupplyChange.py b/python/src/trezorlib/messages/NEMMosaicSupplyChange.py index 08ad85290f..de66ef9358 100644 --- a/python/src/trezorlib/messages/NEMMosaicSupplyChange.py +++ b/python/src/trezorlib/messages/NEMMosaicSupplyChange.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMSupplyChangeType = Literal[1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeNEMSupplyChangeType = None # type: ignore + pass class NEMMosaicSupplyChange(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMProvisionNamespace.py b/python/src/trezorlib/messages/NEMProvisionNamespace.py index f62bd4e394..3bf754674b 100644 --- a/python/src/trezorlib/messages/NEMProvisionNamespace.py +++ b/python/src/trezorlib/messages/NEMProvisionNamespace.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMProvisionNamespace(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMSignTx.py b/python/src/trezorlib/messages/NEMSignTx.py index f807a4d951..6d4e6a8da6 100644 --- a/python/src/trezorlib/messages/NEMSignTx.py +++ b/python/src/trezorlib/messages/NEMSignTx.py @@ -12,10 +12,10 @@ from .NEMTransfer import NEMTransfer if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMSignedTx.py b/python/src/trezorlib/messages/NEMSignedTx.py index 4497efcc10..2dc9859b63 100644 --- a/python/src/trezorlib/messages/NEMSignedTx.py +++ b/python/src/trezorlib/messages/NEMSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMSupplyChangeType.py b/python/src/trezorlib/messages/NEMSupplyChangeType.py index 1a4f79b94f..77f12b16ca 100644 --- a/python/src/trezorlib/messages/NEMSupplyChangeType.py +++ b/python/src/trezorlib/messages/NEMSupplyChangeType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -SupplyChange_Increase = 1 -SupplyChange_Decrease = 2 +if False: + from typing_extensions import Literal + +SupplyChange_Increase = 1 # type: Literal[1] +SupplyChange_Decrease = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/NEMTransactionCommon.py b/python/src/trezorlib/messages/NEMTransactionCommon.py index 49d3b50b4a..14afd73c87 100644 --- a/python/src/trezorlib/messages/NEMTransactionCommon.py +++ b/python/src/trezorlib/messages/NEMTransactionCommon.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMTransactionCommon(p.MessageType): diff --git a/python/src/trezorlib/messages/NEMTransfer.py b/python/src/trezorlib/messages/NEMTransfer.py index eded5b46ee..d9e901b68b 100644 --- a/python/src/trezorlib/messages/NEMTransfer.py +++ b/python/src/trezorlib/messages/NEMTransfer.py @@ -6,10 +6,10 @@ from .NEMMosaic import NEMMosaic if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class NEMTransfer(p.MessageType): diff --git a/python/src/trezorlib/messages/OutputScriptType.py b/python/src/trezorlib/messages/OutputScriptType.py index 6a9b7eb391..bd334789c8 100644 --- a/python/src/trezorlib/messages/OutputScriptType.py +++ b/python/src/trezorlib/messages/OutputScriptType.py @@ -1,8 +1,11 @@ # Automatically generated by pb2py # fmt: off -PAYTOADDRESS = 0 -PAYTOSCRIPTHASH = 1 -PAYTOMULTISIG = 2 -PAYTOOPRETURN = 3 -PAYTOWITNESS = 4 -PAYTOP2SHWITNESS = 5 +if False: + from typing_extensions import Literal + +PAYTOADDRESS = 0 # type: Literal[0] +PAYTOSCRIPTHASH = 1 # type: Literal[1] +PAYTOMULTISIG = 2 # type: Literal[2] +PAYTOOPRETURN = 3 # type: Literal[3] +PAYTOWITNESS = 4 # type: Literal[4] +PAYTOP2SHWITNESS = 5 # type: Literal[5] diff --git a/python/src/trezorlib/messages/PassphraseAck.py b/python/src/trezorlib/messages/PassphraseAck.py index 6cafc49af2..65f7be27b0 100644 --- a/python/src/trezorlib/messages/PassphraseAck.py +++ b/python/src/trezorlib/messages/PassphraseAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseAck(p.MessageType): diff --git a/python/src/trezorlib/messages/PassphraseRequest.py b/python/src/trezorlib/messages/PassphraseRequest.py index bdd6aa1ea3..94a5bdbac6 100644 --- a/python/src/trezorlib/messages/PassphraseRequest.py +++ b/python/src/trezorlib/messages/PassphraseRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/PassphraseSourceType.py b/python/src/trezorlib/messages/PassphraseSourceType.py index 3bce46d10a..d62ea047d3 100644 --- a/python/src/trezorlib/messages/PassphraseSourceType.py +++ b/python/src/trezorlib/messages/PassphraseSourceType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -ASK = 0 -DEVICE = 1 -HOST = 2 +if False: + from typing_extensions import Literal + +ASK = 0 # type: Literal[0] +DEVICE = 1 # type: Literal[1] +HOST = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/PassphraseStateAck.py b/python/src/trezorlib/messages/PassphraseStateAck.py index 1717fa911a..1faedc1c5d 100644 --- a/python/src/trezorlib/messages/PassphraseStateAck.py +++ b/python/src/trezorlib/messages/PassphraseStateAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseStateAck(p.MessageType): diff --git a/python/src/trezorlib/messages/PassphraseStateRequest.py b/python/src/trezorlib/messages/PassphraseStateRequest.py index c39a51d6ec..6cbcbe58b2 100644 --- a/python/src/trezorlib/messages/PassphraseStateRequest.py +++ b/python/src/trezorlib/messages/PassphraseStateRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PassphraseStateRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/PinMatrixAck.py b/python/src/trezorlib/messages/PinMatrixAck.py index dcf0cba8af..2d093efa1f 100644 --- a/python/src/trezorlib/messages/PinMatrixAck.py +++ b/python/src/trezorlib/messages/PinMatrixAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PinMatrixAck(p.MessageType): diff --git a/python/src/trezorlib/messages/PinMatrixRequest.py b/python/src/trezorlib/messages/PinMatrixRequest.py index 9047e6d584..a37241e67b 100644 --- a/python/src/trezorlib/messages/PinMatrixRequest.py +++ b/python/src/trezorlib/messages/PinMatrixRequest.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypePinMatrixRequestType = Literal[1, 2, 3] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypePinMatrixRequestType = None # type: ignore + pass class PinMatrixRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/PinMatrixRequestType.py b/python/src/trezorlib/messages/PinMatrixRequestType.py index 2010103cb8..ca6535e780 100644 --- a/python/src/trezorlib/messages/PinMatrixRequestType.py +++ b/python/src/trezorlib/messages/PinMatrixRequestType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -Current = 1 -NewFirst = 2 -NewSecond = 3 +if False: + from typing_extensions import Literal + +Current = 1 # type: Literal[1] +NewFirst = 2 # type: Literal[2] +NewSecond = 3 # type: Literal[3] diff --git a/python/src/trezorlib/messages/Ping.py b/python/src/trezorlib/messages/Ping.py index b2d7f6dc19..5f34b81baa 100644 --- a/python/src/trezorlib/messages/Ping.py +++ b/python/src/trezorlib/messages/Ping.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Ping(p.MessageType): diff --git a/python/src/trezorlib/messages/PublicKey.py b/python/src/trezorlib/messages/PublicKey.py index ff6c41870a..3c2b7a6728 100644 --- a/python/src/trezorlib/messages/PublicKey.py +++ b/python/src/trezorlib/messages/PublicKey.py @@ -6,10 +6,10 @@ from .HDNodeType import HDNodeType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class PublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/RecoveryDevice.py b/python/src/trezorlib/messages/RecoveryDevice.py index feea78541c..4f94b43fba 100644 --- a/python/src/trezorlib/messages/RecoveryDevice.py +++ b/python/src/trezorlib/messages/RecoveryDevice.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeRecoveryDeviceType = Literal[0, 1] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeRecoveryDeviceType = None # type: ignore + pass class RecoveryDevice(p.MessageType): diff --git a/python/src/trezorlib/messages/RecoveryDeviceType.py b/python/src/trezorlib/messages/RecoveryDeviceType.py index f6f643ac72..6a87da0009 100644 --- a/python/src/trezorlib/messages/RecoveryDeviceType.py +++ b/python/src/trezorlib/messages/RecoveryDeviceType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -ScrambledWords = 0 -Matrix = 1 +if False: + from typing_extensions import Literal + +ScrambledWords = 0 # type: Literal[0] +Matrix = 1 # type: Literal[1] diff --git a/python/src/trezorlib/messages/RequestType.py b/python/src/trezorlib/messages/RequestType.py index 4c122c9447..810076752b 100644 --- a/python/src/trezorlib/messages/RequestType.py +++ b/python/src/trezorlib/messages/RequestType.py @@ -1,7 +1,10 @@ # Automatically generated by pb2py # fmt: off -TXINPUT = 0 -TXOUTPUT = 1 -TXMETA = 2 -TXFINISHED = 3 -TXEXTRADATA = 4 +if False: + from typing_extensions import Literal + +TXINPUT = 0 # type: Literal[0] +TXOUTPUT = 1 # type: Literal[1] +TXMETA = 2 # type: Literal[2] +TXFINISHED = 3 # type: Literal[3] +TXEXTRADATA = 4 # type: Literal[4] diff --git a/python/src/trezorlib/messages/ResetDevice.py b/python/src/trezorlib/messages/ResetDevice.py index 74aa83f1ce..e4b588c6d2 100644 --- a/python/src/trezorlib/messages/ResetDevice.py +++ b/python/src/trezorlib/messages/ResetDevice.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeBackupType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeBackupType = None # type: ignore + pass class ResetDevice(p.MessageType): diff --git a/python/src/trezorlib/messages/RippleAddress.py b/python/src/trezorlib/messages/RippleAddress.py index 7ddf1bf938..1ba81d0328 100644 --- a/python/src/trezorlib/messages/RippleAddress.py +++ b/python/src/trezorlib/messages/RippleAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/RippleGetAddress.py b/python/src/trezorlib/messages/RippleGetAddress.py index feed574367..d78372db2d 100644 --- a/python/src/trezorlib/messages/RippleGetAddress.py +++ b/python/src/trezorlib/messages/RippleGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/RipplePayment.py b/python/src/trezorlib/messages/RipplePayment.py index eb51de89b1..3d1d2ede77 100644 --- a/python/src/trezorlib/messages/RipplePayment.py +++ b/python/src/trezorlib/messages/RipplePayment.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RipplePayment(p.MessageType): diff --git a/python/src/trezorlib/messages/RippleSignTx.py b/python/src/trezorlib/messages/RippleSignTx.py index add6be8e6a..9f262e7761 100644 --- a/python/src/trezorlib/messages/RippleSignTx.py +++ b/python/src/trezorlib/messages/RippleSignTx.py @@ -6,10 +6,10 @@ from .RipplePayment import RipplePayment if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/RippleSignedTx.py b/python/src/trezorlib/messages/RippleSignedTx.py index 4397fcd29a..e9c0386d87 100644 --- a/python/src/trezorlib/messages/RippleSignedTx.py +++ b/python/src/trezorlib/messages/RippleSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class RippleSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/SdProtect.py b/python/src/trezorlib/messages/SdProtect.py index 48493f952c..423cbf33d2 100644 --- a/python/src/trezorlib/messages/SdProtect.py +++ b/python/src/trezorlib/messages/SdProtect.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeSdProtectOperationType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeSdProtectOperationType = None # type: ignore + pass class SdProtect(p.MessageType): diff --git a/python/src/trezorlib/messages/SdProtectOperationType.py b/python/src/trezorlib/messages/SdProtectOperationType.py index c3960723b1..17e1b0d4b9 100644 --- a/python/src/trezorlib/messages/SdProtectOperationType.py +++ b/python/src/trezorlib/messages/SdProtectOperationType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -DISABLE = 0 -ENABLE = 1 -REFRESH = 2 +if False: + from typing_extensions import Literal + +DISABLE = 0 # type: Literal[0] +ENABLE = 1 # type: Literal[1] +REFRESH = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/SelfTest.py b/python/src/trezorlib/messages/SelfTest.py index fdac7a38a2..fa5f7dcef6 100644 --- a/python/src/trezorlib/messages/SelfTest.py +++ b/python/src/trezorlib/messages/SelfTest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SelfTest(p.MessageType): diff --git a/python/src/trezorlib/messages/SetU2FCounter.py b/python/src/trezorlib/messages/SetU2FCounter.py index 2e399ee7d1..d5102fa79d 100644 --- a/python/src/trezorlib/messages/SetU2FCounter.py +++ b/python/src/trezorlib/messages/SetU2FCounter.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SetU2FCounter(p.MessageType): diff --git a/python/src/trezorlib/messages/SignIdentity.py b/python/src/trezorlib/messages/SignIdentity.py index 923b163274..4c008cfbd9 100644 --- a/python/src/trezorlib/messages/SignIdentity.py +++ b/python/src/trezorlib/messages/SignIdentity.py @@ -6,10 +6,10 @@ from .IdentityType import IdentityType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SignIdentity(p.MessageType): diff --git a/python/src/trezorlib/messages/SignMessage.py b/python/src/trezorlib/messages/SignMessage.py index 15fe907732..2e560247e2 100644 --- a/python/src/trezorlib/messages/SignMessage.py +++ b/python/src/trezorlib/messages/SignMessage.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class SignMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/SignTx.py b/python/src/trezorlib/messages/SignTx.py index bfd05c198e..c34c04bb12 100644 --- a/python/src/trezorlib/messages/SignTx.py +++ b/python/src/trezorlib/messages/SignTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/SignedIdentity.py b/python/src/trezorlib/messages/SignedIdentity.py index c2555d46c1..b986b7ae28 100644 --- a/python/src/trezorlib/messages/SignedIdentity.py +++ b/python/src/trezorlib/messages/SignedIdentity.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class SignedIdentity(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarAccountMergeOp.py b/python/src/trezorlib/messages/StellarAccountMergeOp.py index acf3a5241d..2354ee2294 100644 --- a/python/src/trezorlib/messages/StellarAccountMergeOp.py +++ b/python/src/trezorlib/messages/StellarAccountMergeOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAccountMergeOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarAddress.py b/python/src/trezorlib/messages/StellarAddress.py index 1176e3c0d8..7e5e1d640e 100644 --- a/python/src/trezorlib/messages/StellarAddress.py +++ b/python/src/trezorlib/messages/StellarAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarAllowTrustOp.py b/python/src/trezorlib/messages/StellarAllowTrustOp.py index 8cb252dfad..af76584fd5 100644 --- a/python/src/trezorlib/messages/StellarAllowTrustOp.py +++ b/python/src/trezorlib/messages/StellarAllowTrustOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAllowTrustOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarAssetType.py b/python/src/trezorlib/messages/StellarAssetType.py index f6585de435..472322a8d2 100644 --- a/python/src/trezorlib/messages/StellarAssetType.py +++ b/python/src/trezorlib/messages/StellarAssetType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarAssetType(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarBumpSequenceOp.py b/python/src/trezorlib/messages/StellarBumpSequenceOp.py index 321d80f455..a9b11318ce 100644 --- a/python/src/trezorlib/messages/StellarBumpSequenceOp.py +++ b/python/src/trezorlib/messages/StellarBumpSequenceOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarBumpSequenceOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarChangeTrustOp.py b/python/src/trezorlib/messages/StellarChangeTrustOp.py index af56938a18..0d484d020e 100644 --- a/python/src/trezorlib/messages/StellarChangeTrustOp.py +++ b/python/src/trezorlib/messages/StellarChangeTrustOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarChangeTrustOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarCreateAccountOp.py b/python/src/trezorlib/messages/StellarCreateAccountOp.py index f91f71d165..bffc2dd1d3 100644 --- a/python/src/trezorlib/messages/StellarCreateAccountOp.py +++ b/python/src/trezorlib/messages/StellarCreateAccountOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarCreateAccountOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarCreatePassiveOfferOp.py b/python/src/trezorlib/messages/StellarCreatePassiveOfferOp.py index ad1b732bfa..1457ae1156 100644 --- a/python/src/trezorlib/messages/StellarCreatePassiveOfferOp.py +++ b/python/src/trezorlib/messages/StellarCreatePassiveOfferOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarCreatePassiveOfferOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarGetAddress.py b/python/src/trezorlib/messages/StellarGetAddress.py index 4bfb586edf..cee2fe306f 100644 --- a/python/src/trezorlib/messages/StellarGetAddress.py +++ b/python/src/trezorlib/messages/StellarGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarManageDataOp.py b/python/src/trezorlib/messages/StellarManageDataOp.py index f8b64ca7ed..499c964989 100644 --- a/python/src/trezorlib/messages/StellarManageDataOp.py +++ b/python/src/trezorlib/messages/StellarManageDataOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarManageDataOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarManageOfferOp.py b/python/src/trezorlib/messages/StellarManageOfferOp.py index f385812732..c71a0f6c93 100644 --- a/python/src/trezorlib/messages/StellarManageOfferOp.py +++ b/python/src/trezorlib/messages/StellarManageOfferOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarManageOfferOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarPathPaymentOp.py b/python/src/trezorlib/messages/StellarPathPaymentOp.py index a50ff0b6ae..f33fa2a09a 100644 --- a/python/src/trezorlib/messages/StellarPathPaymentOp.py +++ b/python/src/trezorlib/messages/StellarPathPaymentOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarPathPaymentOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarPaymentOp.py b/python/src/trezorlib/messages/StellarPaymentOp.py index 3800cdba68..8bc90de976 100644 --- a/python/src/trezorlib/messages/StellarPaymentOp.py +++ b/python/src/trezorlib/messages/StellarPaymentOp.py @@ -6,10 +6,10 @@ from .StellarAssetType import StellarAssetType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarPaymentOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarSetOptionsOp.py b/python/src/trezorlib/messages/StellarSetOptionsOp.py index 83630879e5..1989c94358 100644 --- a/python/src/trezorlib/messages/StellarSetOptionsOp.py +++ b/python/src/trezorlib/messages/StellarSetOptionsOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarSetOptionsOp(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarSignTx.py b/python/src/trezorlib/messages/StellarSignTx.py index d782b437e6..4d05676758 100644 --- a/python/src/trezorlib/messages/StellarSignTx.py +++ b/python/src/trezorlib/messages/StellarSignTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarSignedTx.py b/python/src/trezorlib/messages/StellarSignedTx.py index 586ef2164d..2a47e691f9 100644 --- a/python/src/trezorlib/messages/StellarSignedTx.py +++ b/python/src/trezorlib/messages/StellarSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/StellarTxOpRequest.py b/python/src/trezorlib/messages/StellarTxOpRequest.py index 40c3895720..ade0bab6f5 100644 --- a/python/src/trezorlib/messages/StellarTxOpRequest.py +++ b/python/src/trezorlib/messages/StellarTxOpRequest.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class StellarTxOpRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/Success.py b/python/src/trezorlib/messages/Success.py index 643ae0b078..f9e9df42d3 100644 --- a/python/src/trezorlib/messages/Success.py +++ b/python/src/trezorlib/messages/Success.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class Success(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosAddress.py b/python/src/trezorlib/messages/TezosAddress.py index 09e3fee4c3..ff77bed5bf 100644 --- a/python/src/trezorlib/messages/TezosAddress.py +++ b/python/src/trezorlib/messages/TezosAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosBallotOp.py b/python/src/trezorlib/messages/TezosBallotOp.py index 4ab4f6ea1c..3bf4ee6177 100644 --- a/python/src/trezorlib/messages/TezosBallotOp.py +++ b/python/src/trezorlib/messages/TezosBallotOp.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeTezosBallotType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeTezosBallotType = None # type: ignore + pass class TezosBallotOp(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosBallotType.py b/python/src/trezorlib/messages/TezosBallotType.py index 1d955862f5..d32901955c 100644 --- a/python/src/trezorlib/messages/TezosBallotType.py +++ b/python/src/trezorlib/messages/TezosBallotType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -Yay = 0 -Nay = 1 -Pass = 2 +if False: + from typing_extensions import Literal + +Yay = 0 # type: Literal[0] +Nay = 1 # type: Literal[1] +Pass = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/TezosContractID.py b/python/src/trezorlib/messages/TezosContractID.py index 9a3c840445..0c1bac6df1 100644 --- a/python/src/trezorlib/messages/TezosContractID.py +++ b/python/src/trezorlib/messages/TezosContractID.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeTezosContractType = Literal[0, 1] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeTezosContractType = None # type: ignore + pass class TezosContractID(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosContractType.py b/python/src/trezorlib/messages/TezosContractType.py index 04275b086c..211f451e22 100644 --- a/python/src/trezorlib/messages/TezosContractType.py +++ b/python/src/trezorlib/messages/TezosContractType.py @@ -1,4 +1,7 @@ # Automatically generated by pb2py # fmt: off -Implicit = 0 -Originated = 1 +if False: + from typing_extensions import Literal + +Implicit = 0 # type: Literal[0] +Originated = 1 # type: Literal[1] diff --git a/python/src/trezorlib/messages/TezosDelegationOp.py b/python/src/trezorlib/messages/TezosDelegationOp.py index 2b16836084..08d47e594b 100644 --- a/python/src/trezorlib/messages/TezosDelegationOp.py +++ b/python/src/trezorlib/messages/TezosDelegationOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosDelegationOp(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosGetAddress.py b/python/src/trezorlib/messages/TezosGetAddress.py index d62e8efa59..91d613193c 100644 --- a/python/src/trezorlib/messages/TezosGetAddress.py +++ b/python/src/trezorlib/messages/TezosGetAddress.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosGetAddress(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosGetPublicKey.py b/python/src/trezorlib/messages/TezosGetPublicKey.py index fb4e733c21..92f0d36cca 100644 --- a/python/src/trezorlib/messages/TezosGetPublicKey.py +++ b/python/src/trezorlib/messages/TezosGetPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosGetPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosOriginationOp.py b/python/src/trezorlib/messages/TezosOriginationOp.py index 509612553a..63b607c8ab 100644 --- a/python/src/trezorlib/messages/TezosOriginationOp.py +++ b/python/src/trezorlib/messages/TezosOriginationOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosOriginationOp(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosProposalOp.py b/python/src/trezorlib/messages/TezosProposalOp.py index 1ce7089f9f..ded5df7eea 100644 --- a/python/src/trezorlib/messages/TezosProposalOp.py +++ b/python/src/trezorlib/messages/TezosProposalOp.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosProposalOp(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosPublicKey.py b/python/src/trezorlib/messages/TezosPublicKey.py index ddcb11f458..5df6cf205a 100644 --- a/python/src/trezorlib/messages/TezosPublicKey.py +++ b/python/src/trezorlib/messages/TezosPublicKey.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosPublicKey(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosRevealOp.py b/python/src/trezorlib/messages/TezosRevealOp.py index 2471b97893..ae7728ea88 100644 --- a/python/src/trezorlib/messages/TezosRevealOp.py +++ b/python/src/trezorlib/messages/TezosRevealOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosRevealOp(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosSignTx.py b/python/src/trezorlib/messages/TezosSignTx.py index 3e29e19e02..5425aff733 100644 --- a/python/src/trezorlib/messages/TezosSignTx.py +++ b/python/src/trezorlib/messages/TezosSignTx.py @@ -11,10 +11,10 @@ from .TezosTransactionOp import TezosTransactionOp if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosSignTx(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosSignedTx.py b/python/src/trezorlib/messages/TezosSignedTx.py index f232a87780..c73a927a1b 100644 --- a/python/src/trezorlib/messages/TezosSignedTx.py +++ b/python/src/trezorlib/messages/TezosSignedTx.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosSignedTx(p.MessageType): diff --git a/python/src/trezorlib/messages/TezosTransactionOp.py b/python/src/trezorlib/messages/TezosTransactionOp.py index 33e9b4e26b..775f961b73 100644 --- a/python/src/trezorlib/messages/TezosTransactionOp.py +++ b/python/src/trezorlib/messages/TezosTransactionOp.py @@ -6,10 +6,10 @@ from .TezosContractID import TezosContractID if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TezosTransactionOp(p.MessageType): diff --git a/python/src/trezorlib/messages/TransactionType.py b/python/src/trezorlib/messages/TransactionType.py index e289d4555c..c3eb7698d6 100644 --- a/python/src/trezorlib/messages/TransactionType.py +++ b/python/src/trezorlib/messages/TransactionType.py @@ -8,10 +8,10 @@ from .TxOutputType import TxOutputType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TransactionType(p.MessageType): diff --git a/python/src/trezorlib/messages/TxAck.py b/python/src/trezorlib/messages/TxAck.py index 2734adb208..8c8315cc6e 100644 --- a/python/src/trezorlib/messages/TxAck.py +++ b/python/src/trezorlib/messages/TxAck.py @@ -6,10 +6,10 @@ from .TransactionType import TransactionType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxAck(p.MessageType): diff --git a/python/src/trezorlib/messages/TxInputType.py b/python/src/trezorlib/messages/TxInputType.py index bc4240e714..8050e2284c 100644 --- a/python/src/trezorlib/messages/TxInputType.py +++ b/python/src/trezorlib/messages/TxInputType.py @@ -6,12 +6,11 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeInputScriptType = None # type: ignore + pass class TxInputType(p.MessageType): diff --git a/python/src/trezorlib/messages/TxOutputBinType.py b/python/src/trezorlib/messages/TxOutputBinType.py index 965b3d8ecb..d828b9c91c 100644 --- a/python/src/trezorlib/messages/TxOutputBinType.py +++ b/python/src/trezorlib/messages/TxOutputBinType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxOutputBinType(p.MessageType): diff --git a/python/src/trezorlib/messages/TxOutputType.py b/python/src/trezorlib/messages/TxOutputType.py index de32eb404d..466a6ce628 100644 --- a/python/src/trezorlib/messages/TxOutputType.py +++ b/python/src/trezorlib/messages/TxOutputType.py @@ -6,12 +6,11 @@ from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeOutputScriptType = Literal[0, 1, 2, 3, 4, 5] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeOutputScriptType = None # type: ignore + pass class TxOutputType(p.MessageType): diff --git a/python/src/trezorlib/messages/TxRequest.py b/python/src/trezorlib/messages/TxRequest.py index e7ad696102..26c2db1a3d 100644 --- a/python/src/trezorlib/messages/TxRequest.py +++ b/python/src/trezorlib/messages/TxRequest.py @@ -7,12 +7,11 @@ from .TxRequestSerializedType import TxRequestSerializedType if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeRequestType = Literal[0, 1, 2, 3, 4] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeRequestType = None # type: ignore + pass class TxRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/TxRequestDetailsType.py b/python/src/trezorlib/messages/TxRequestDetailsType.py index bde924fb65..f378a09c17 100644 --- a/python/src/trezorlib/messages/TxRequestDetailsType.py +++ b/python/src/trezorlib/messages/TxRequestDetailsType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxRequestDetailsType(p.MessageType): diff --git a/python/src/trezorlib/messages/TxRequestSerializedType.py b/python/src/trezorlib/messages/TxRequestSerializedType.py index 20b4b44a4b..433fbf3f6c 100644 --- a/python/src/trezorlib/messages/TxRequestSerializedType.py +++ b/python/src/trezorlib/messages/TxRequestSerializedType.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class TxRequestSerializedType(p.MessageType): diff --git a/python/src/trezorlib/messages/VerifyMessage.py b/python/src/trezorlib/messages/VerifyMessage.py index 96c1fee6b6..c0f6a635e4 100644 --- a/python/src/trezorlib/messages/VerifyMessage.py +++ b/python/src/trezorlib/messages/VerifyMessage.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class VerifyMessage(p.MessageType): diff --git a/python/src/trezorlib/messages/WebAuthnAddResidentCredential.py b/python/src/trezorlib/messages/WebAuthnAddResidentCredential.py index efa17baba4..032b516371 100644 --- a/python/src/trezorlib/messages/WebAuthnAddResidentCredential.py +++ b/python/src/trezorlib/messages/WebAuthnAddResidentCredential.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnAddResidentCredential(p.MessageType): diff --git a/python/src/trezorlib/messages/WebAuthnCredential.py b/python/src/trezorlib/messages/WebAuthnCredential.py index 5294fa1a2e..5edf3d9820 100644 --- a/python/src/trezorlib/messages/WebAuthnCredential.py +++ b/python/src/trezorlib/messages/WebAuthnCredential.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnCredential(p.MessageType): diff --git a/python/src/trezorlib/messages/WebAuthnCredentials.py b/python/src/trezorlib/messages/WebAuthnCredentials.py index 46a5d99244..1f16ce63bd 100644 --- a/python/src/trezorlib/messages/WebAuthnCredentials.py +++ b/python/src/trezorlib/messages/WebAuthnCredentials.py @@ -6,10 +6,10 @@ from .WebAuthnCredential import WebAuthnCredential if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnCredentials(p.MessageType): diff --git a/python/src/trezorlib/messages/WebAuthnListResidentCredentials.py b/python/src/trezorlib/messages/WebAuthnListResidentCredentials.py index 404ebed9ca..44d8c717f4 100644 --- a/python/src/trezorlib/messages/WebAuthnListResidentCredentials.py +++ b/python/src/trezorlib/messages/WebAuthnListResidentCredentials.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnListResidentCredentials(p.MessageType): diff --git a/python/src/trezorlib/messages/WebAuthnRemoveResidentCredential.py b/python/src/trezorlib/messages/WebAuthnRemoveResidentCredential.py index e9484e01c3..fa919764e1 100644 --- a/python/src/trezorlib/messages/WebAuthnRemoveResidentCredential.py +++ b/python/src/trezorlib/messages/WebAuthnRemoveResidentCredential.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WebAuthnRemoveResidentCredential(p.MessageType): diff --git a/python/src/trezorlib/messages/WipeDevice.py b/python/src/trezorlib/messages/WipeDevice.py index ad020af20b..5763181288 100644 --- a/python/src/trezorlib/messages/WipeDevice.py +++ b/python/src/trezorlib/messages/WipeDevice.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WipeDevice(p.MessageType): diff --git a/python/src/trezorlib/messages/WordAck.py b/python/src/trezorlib/messages/WordAck.py index f851e21e9d..c9365bdc8e 100644 --- a/python/src/trezorlib/messages/WordAck.py +++ b/python/src/trezorlib/messages/WordAck.py @@ -4,10 +4,10 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: - Dict, List, Optional = None, None, None # type: ignore + pass class WordAck(p.MessageType): diff --git a/python/src/trezorlib/messages/WordRequest.py b/python/src/trezorlib/messages/WordRequest.py index c3c68a588f..ff9a3ec449 100644 --- a/python/src/trezorlib/messages/WordRequest.py +++ b/python/src/trezorlib/messages/WordRequest.py @@ -4,12 +4,11 @@ from .. import protobuf as p if __debug__: try: - from typing import Dict, List, Optional + from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeWordRequestType = Literal[0, 1, 2] except ImportError: - Dict, List, Optional = None, None, None # type: ignore - EnumTypeWordRequestType = None # type: ignore + pass class WordRequest(p.MessageType): diff --git a/python/src/trezorlib/messages/WordRequestType.py b/python/src/trezorlib/messages/WordRequestType.py index a284fac9c8..82c953777a 100644 --- a/python/src/trezorlib/messages/WordRequestType.py +++ b/python/src/trezorlib/messages/WordRequestType.py @@ -1,5 +1,8 @@ # Automatically generated by pb2py # fmt: off -Plain = 0 -Matrix9 = 1 -Matrix6 = 2 +if False: + from typing_extensions import Literal + +Plain = 0 # type: Literal[0] +Matrix9 = 1 # type: Literal[1] +Matrix6 = 2 # type: Literal[2]