1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-09 16:18:10 +00:00

chore(core): export PropertyType to fix mypy errors

This commit is contained in:
matejcik 2021-06-23 10:02:09 +02:00 committed by matejcik
parent 319a4374d3
commit 015c47d564
3 changed files with 10 additions and 11 deletions

View File

@ -37,6 +37,8 @@ if False:
CardanoAssetGroupType, CardanoAssetGroupType,
) )
from trezor.ui.layouts import PropertyType
ADDRESS_TYPE_NAMES = { ADDRESS_TYPE_NAMES = {
CardanoAddressType.BYRON: "Legacy", CardanoAddressType.BYRON: "Legacy",
@ -217,7 +219,7 @@ async def confirm_transaction(
validity_interval_start: int | None, validity_interval_start: int | None,
is_network_id_verifiable: bool, is_network_id_verifiable: bool,
) -> None: ) -> None:
props = [ props: list[PropertyType] = [
("Transaction amount:", format_coin_amount(amount)), ("Transaction amount:", format_coin_amount(amount)),
("Transaction fee:", format_coin_amount(fee)), ("Transaction fee:", format_coin_amount(fee)),
] ]
@ -467,7 +469,7 @@ async def show_warning_address_foreign_staking_key(
staking_account_path: list[int], staking_account_path: list[int],
staking_key_hash: bytes | None, staking_key_hash: bytes | None,
) -> None: ) -> None:
props: list[tuple[str, str | None]] = [ props: list[PropertyType] = [
( (
"Stake rights associated with this address do not match your account %s:" "Stake rights associated with this address do not match your account %s:"
% format_account_number(account_path), % format_account_number(account_path),

View File

@ -3,9 +3,11 @@ from trezor.enums import ButtonRequestType
from trezor.messages import ButtonAck, ButtonRequest from trezor.messages import ButtonAck, ButtonRequest
if False: if False:
from typing import Any, Awaitable from typing import Any, Awaitable, Optional, Tuple, Type, Union
LayoutType = Awaitable[Any] LayoutType = Awaitable[Any]
PropertyType = Tuple[Optional[str], Union[str, bytes, None]]
ExceptionType = Union[BaseException, Type[BaseException]]
if __debug__: if __debug__:

View File

@ -1,5 +1,4 @@
from micropython import const from micropython import const
from ubinascii import hexlify from ubinascii import hexlify
from trezor import ui, wire from trezor import ui, wire
@ -14,11 +13,11 @@ from ..components.common.confirm import is_confirmed, raise_if_cancelled
from ..components.tt.button import ButtonCancel, ButtonDefault from ..components.tt.button import ButtonCancel, ButtonDefault
from ..components.tt.confirm import Confirm, HoldToConfirm from ..components.tt.confirm import Confirm, HoldToConfirm
from ..components.tt.scroll import ( from ..components.tt.scroll import (
PAGEBREAK,
PAGINATED_LINE_WIDTH,
Paginated, Paginated,
paginate_paragraphs, paginate_paragraphs,
paginate_text, paginate_text,
PAGINATED_LINE_WIDTH,
PAGEBREAK,
) )
from ..components.tt.text import Span, Text from ..components.tt.text import Span, Text
from ..constants.tt import ( from ..constants.tt import (
@ -36,15 +35,11 @@ if False:
Awaitable, Awaitable,
Iterator, Iterator,
NoReturn, NoReturn,
Optional,
Sequence, Sequence,
Tuple, Tuple,
Type,
Union,
) )
ExceptionType = Union[BaseException, Type[BaseException]] from .common import PropertyType, ExceptionType
PropertyType = Tuple[Optional[str], Union[str, bytes, None]]
__all__ = ( __all__ = (