chore: upgrade style checkers

black 24.2.0
flake8 7.0.0

some neat improvements for if-else statements there
pull/3572/head
matejcik 2 months ago committed by matejcik
parent 89c356c651
commit 5f016a896a

@ -40,11 +40,9 @@ if TYPE_CHECKING:
keychain: Keychain,
coin: CoinInfo,
approver: approvers.Approver | None,
) -> None:
...
) -> None: ...
async def signer(self) -> None:
...
async def signer(self) -> None: ...
@with_keychain

@ -18,11 +18,9 @@ if TYPE_CHECKING:
from ..common import SigHashType
class SigHasher(Protocol):
def add_input(self, txi: TxInput, script_pubkey: bytes) -> None:
...
def add_input(self, txi: TxInput, script_pubkey: bytes) -> None: ...
def add_output(self, txo: TxOutput, script_pubkey: bytes) -> None:
...
def add_output(self, txo: TxOutput, script_pubkey: bytes) -> None: ...
def hash143(
self,
@ -32,23 +30,20 @@ if TYPE_CHECKING:
tx: SignTx | PrevTx,
coin: coininfo.CoinInfo,
hash_type: int,
) -> bytes:
...
) -> bytes: ...
def hash341(
self,
i: int,
tx: SignTx | PrevTx,
sighash_type: SigHashType,
) -> bytes:
...
) -> bytes: ...
def hash_zip244(
self,
txi: TxInput | None,
script_pubkey: bytes | None,
) -> bytes:
...
) -> bytes: ...
# BIP-0143 hash

@ -16,24 +16,20 @@ if TYPE_CHECKING:
class Signer(Protocol):
coin: CoinInfo
def create_hash_writer(self) -> HashWriter:
...
def create_hash_writer(self) -> HashWriter: ...
def create_sig_hasher(self, tx: SignTx | PrevTx) -> SigHasher:
...
def create_sig_hasher(self, tx: SignTx | PrevTx) -> SigHasher: ...
def write_tx_header(
self,
w: writers.Writer,
tx: SignTx | PrevTx,
witness_marker: bool,
) -> None:
...
) -> None: ...
async def write_prev_tx_footer(
self, w: writers.Writer, tx: PrevTx, prev_hash: bytes
) -> None:
...
) -> None: ...
# The chain id used for change.

@ -827,9 +827,11 @@ async def confirm_cvote_registration(
props.append(
(
TR.cardano__voting_purpose,
TR.cardano__catalyst
if voting_purpose == 0
else f"{voting_purpose} ({TR.cardano__other})",
(
TR.cardano__catalyst
if voting_purpose == 0
else f"{voting_purpose} ({TR.cardano__other})"
),
)
)
@ -864,9 +866,11 @@ async def confirm_token_minting(policy_id: bytes, token: messages.CardanoToken)
),
),
(
TR.cardano__amount_minted_decimals_unknown
if token.mint_amount >= 0
else TR.cardano__amount_burned_decimals_unknown,
(
TR.cardano__amount_minted_decimals_unknown
if token.mint_amount >= 0
else TR.cardano__amount_burned_decimals_unknown
),
format_amount(token.mint_amount, 0),
),
),

@ -510,11 +510,11 @@ class Signer:
output_value_list.append(output.amount)
asset_groups_dict: HashBuilderDict[
bytes, HashBuilderDict[bytes, int]
] = HashBuilderDict(
output.asset_groups_count,
ProcessError("Invalid token bundle in output"),
asset_groups_dict: HashBuilderDict[bytes, HashBuilderDict[bytes, int]] = (
HashBuilderDict(
output.asset_groups_count,
ProcessError("Invalid token bundle in output"),
)
)
with output_value_list.append(asset_groups_dict):
await self._process_asset_groups(

@ -16,14 +16,11 @@ if TYPE_CHECKING:
T = TypeVar("T")
class NodeProtocol(Protocol[paths.PathType]):
def derive_path(self, path: paths.PathType) -> None:
...
def derive_path(self, path: paths.PathType) -> None: ...
def clone(self: T) -> T:
...
def clone(self: T) -> T: ...
def __del__(self) -> None:
...
def __del__(self) -> None: ...
NodeType = TypeVar("NodeType", bound=NodeProtocol)
@ -34,8 +31,7 @@ if TYPE_CHECKING:
HandlerWithKeychain = Callable[[MsgIn, "Keychain"], Awaitable[MsgOut]]
class Deletable(Protocol):
def __del__(self) -> None:
...
def __del__(self) -> None: ...
FORBIDDEN_KEY_PATH = DataError("Forbidden key path")

@ -14,15 +14,12 @@ if TYPE_CHECKING:
PathType = TypeVar("PathType", Bip32Path, Slip21Path, contravariant=True)
class PathSchemaType(Protocol):
def match(self, path: Bip32Path) -> bool:
...
def match(self, path: Bip32Path) -> bool: ...
class KeychainValidatorType(Protocol):
def is_in_keychain(self, path: Bip32Path) -> bool:
...
def is_in_keychain(self, path: Bip32Path) -> bool: ...
def verify_path(self, path: Bip32Path) -> None:
...
def verify_path(self, path: Bip32Path) -> None: ...
class Interval:

@ -14,6 +14,7 @@ encrypted using the private spend key. Here the host sends it back
in `MoneroGetTxKeyRequest.tx_enc_keys` to be decrypted and yet again encrypted
using the view key, which the host possess.
"""
from micropython import const
from typing import TYPE_CHECKING

@ -2,7 +2,6 @@
Initializes a new transaction.
"""
from typing import TYPE_CHECKING
from apps.monero import signing

@ -11,6 +11,7 @@ If number of inputs is small, in-memory mode is used = alpha, pseudo_outs are ke
Otherwise pseudo_outs are offloaded with HMAC, alpha is offloaded encrypted under chacha_poly with
key derived for exactly this purpose.
"""
from typing import TYPE_CHECKING
from apps.monero.xmr import crypto_helpers

@ -2,6 +2,7 @@
Output destinations are streamed one by one.
Computes destination one-time address, amount key, range proof + HMAC, out_pk, ecdh_info.
"""
from typing import TYPE_CHECKING
from trezor import utils

@ -56,8 +56,7 @@ if TYPE_CHECKING:
T = TypeVar("T")
def _list_of_type(lst: list[Any], typ: type[T]) -> TypeGuard[list[T]]:
...
def _list_of_type(lst: list[Any], typ: type[T]) -> TypeGuard[list[T]]: ...
_HASH_KEY_CLSAG_ROUND = b"CLSAG_round\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

@ -16,23 +16,18 @@ if TYPE_CHECKING:
XmrFspec = tuple[XmrFieldType, ...]
class Writer(Protocol):
def write(self, __data: bytes) -> None:
...
def write(self, __data: bytes) -> None: ...
class Reader(Protocol):
def readinto(self, __buffer: bytearray | memoryview) -> int:
...
def readinto(self, __buffer: bytearray | memoryview) -> int: ...
class XmrType(Protocol[T]):
def load(self, __reader: Reader) -> T:
...
def load(self, __reader: Reader) -> T: ...
def dump(self, __writer: Writer, __value: T) -> None:
...
def dump(self, __writer: Writer, __value: T) -> None: ...
class XmrStructuredType(XmrType):
def f_specs(self) -> XmrFspec:
...
def f_specs(self) -> XmrFspec: ...
class UVarintType:

@ -95,12 +95,12 @@ def _write_property(w: Writer, name: str, value: int | bool | str | None) -> Non
value = 0
elif name in ("supplyMutable", "transferable"):
value = False
if type(value) == bool:
if isinstance(value, bool):
if value:
value = "true"
else:
value = "false"
elif type(value) == int:
elif isinstance(value, int):
value = str(value)
if not isinstance(value, str):
raise ValueError("Incompatible value type")

@ -302,10 +302,10 @@ async def confirm_token_transfer(
br_code=ButtonRequestType.ConfirmOutput,
verb=TR.buttons__continue,
info_items=(
(f"{TR.solana__associated_token_account}:", base58.encode(token_account)),
)
if token_account != destination_account
else None,
((f"{TR.solana__associated_token_account}:", base58.encode(token_account)),)
if token_account != destination_account
else None
),
)
await confirm_value(

@ -53,15 +53,19 @@ async def require_confirm_timebounds(start: int, end: int) -> None:
(
(
TR.stellar__valid_from,
strings.format_timestamp(start)
if start > 0
else TR.stellar__no_restriction,
(
strings.format_timestamp(start)
if start > 0
else TR.stellar__no_restriction
),
),
(
TR.stellar__valid_to,
strings.format_timestamp(end)
if end > 0
else TR.stellar__no_restriction,
(
strings.format_timestamp(end)
if end > 0
else TR.stellar__no_restriction
),
),
),
)

@ -123,9 +123,11 @@ async def _confirm_manage_offer_op_common(
async def _confirm_offer(
title: str,
op: StellarCreatePassiveSellOfferOp
| StellarManageSellOfferOp
| StellarManageBuyOfferOp,
op: (
StellarCreatePassiveSellOfferOp
| StellarManageSellOfferOp
| StellarManageBuyOfferOp
),
) -> None:
from trezor.messages import StellarManageBuyOfferOp

@ -317,10 +317,9 @@ def _get_operation_bytes(w: Writer, msg: TezosSignTx) -> None:
def _encode_common(
w: Writer,
operation: TezosDelegationOp
| TezosOriginationOp
| TezosTransactionOp
| TezosRevealOp,
operation: (
TezosDelegationOp | TezosOriginationOp | TezosTransactionOp | TezosRevealOp
),
str_operation: str,
) -> None:
operation_tags = {

@ -70,7 +70,7 @@ def encode(receivers: dict[Typecode, bytes], coin: CoinInfo) -> str:
receivers_list = list(receivers.items())
receivers_list.sort()
for (typecode, raw_bytes) in receivers_list:
for typecode, raw_bytes in receivers_list:
length = RECEIVER_LENGTHS.get(typecode) or len(raw_bytes)
write_compact_size(w, typecode)
write_compact_size(w, length)

@ -71,8 +71,7 @@ class DataCache:
if TYPE_CHECKING:
@overload
def get(self, key: int) -> bytes | None:
...
def get(self, key: int) -> bytes | None: ...
@overload
def get(self, key: int, default: T) -> bytes | T: # noqa: F811
@ -254,8 +253,7 @@ def set_int(key: int, value: int) -> None:
if TYPE_CHECKING:
@overload
def get(key: int) -> bytes | None:
...
def get(key: int) -> bytes | None: ...
@overload
def get(key: int, default: T) -> bytes | T: # noqa: F811

@ -13,8 +13,7 @@ if TYPE_CHECKING:
ExceptionType = BaseException | type[BaseException]
class ProgressLayout(Protocol):
def report(self, value: int, description: str | None = None) -> None:
...
def report(self, value: int, description: str | None = None) -> None: ...
async def button_request(

@ -144,24 +144,19 @@ def chunks(items: Chunkable, size: int) -> Iterator[Chunkable]:
if TYPE_CHECKING:
class HashContext(Protocol):
def update(self, __buf: bytes) -> None:
...
def update(self, __buf: bytes) -> None: ...
def digest(self) -> bytes:
...
def digest(self) -> bytes: ...
class HashContextInitable(HashContext, Protocol):
def __init__( # pylint: disable=super-init-not-called
self, __data: bytes | None = None
) -> None:
...
) -> None: ...
class Writer(Protocol):
def append(self, __b: int) -> None:
...
def append(self, __b: int) -> None: ...
def extend(self, __buf: bytes) -> None:
...
def extend(self, __buf: bytes) -> None: ...
if False: # noqa
@ -364,11 +359,11 @@ if __debug__:
yield line_start + msg.MESSAGE_NAME + " {"
for key, val in msg_dict.items():
if type(val) == type(msg):
if type(val) is type(msg):
sublines = dump_protobuf_lines(val, line_start=key + ": ")
for subline in sublines:
yield " " + subline
elif val and isinstance(val, list) and type(val[0]) == type(msg):
elif val and isinstance(val, list) and type(val[0]) is type(msg):
# non-empty list of protobuf messages
yield f" {key}: ["
for subval in val:

@ -70,14 +70,14 @@ class Context:
if TYPE_CHECKING:
@overload
async def read(self, expected_types: Container[int]) -> protobuf.MessageType:
...
async def read(
self, expected_types: Container[int]
) -> protobuf.MessageType: ...
@overload
async def read(
self, expected_types: Container[int], expected_type: type[LoadedMessageType]
) -> LoadedMessageType:
...
) -> LoadedMessageType: ...
async def read(
self,

@ -53,7 +53,7 @@ assert public_keys_hex == [
]
print("Sanity check")
for (sk, pk_hex) in zip(secret_keys, public_keys_hex):
for sk, pk_hex in zip(secret_keys, public_keys_hex):
pk = ecdsa.VerifyingKey.from_string(
bytes.fromhex(pk_hex), curve=ecdsa.SECP256k1, hashfunc=sha256
)

332
poetry.lock generated

@ -1,21 +1,23 @@
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
[[package]]
name = "astroid"
version = "2.9.3"
version = "2.15.8"
description = "An abstract syntax tree for Python with inference support."
optional = false
python-versions = ">=3.6.2"
python-versions = ">=3.7.2"
files = [
{file = "astroid-2.9.3-py3-none-any.whl", hash = "sha256:506daabe5edffb7e696ad82483ad0228245a9742ed7d2d8c9cdb31537decf9f6"},
{file = "astroid-2.9.3.tar.gz", hash = "sha256:1efdf4e867d4d8ba4a9f6cf9ce07cd182c4c41de77f23814feb27ca93ca9d877"},
{file = "astroid-2.15.8-py3-none-any.whl", hash = "sha256:1aa149fc5c6589e3d0ece885b4491acd80af4f087baafa3fb5203b113e68cd3c"},
{file = "astroid-2.15.8.tar.gz", hash = "sha256:6c107453dffee9055899705de3c9ead36e74119cee151e5a9aaf7f0b0e020a6a"},
]
[package.dependencies]
lazy-object-proxy = ">=1.4.0"
setuptools = ">=20.0"
typing-extensions = {version = ">=3.10", markers = "python_version < \"3.10\""}
wrapt = ">=1.11,<1.14"
typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""}
wrapt = [
{version = ">=1.11,<2", markers = "python_version < \"3.11\""},
{version = ">=1.14,<2", markers = "python_version >= \"3.11\""},
]
[[package]]
name = "atomicwrites"
@ -77,47 +79,47 @@ typing-extensions = "*"
[[package]]
name = "black"
version = "22.3.0"
version = "24.2.0"
description = "The uncompromising code formatter."
optional = false
python-versions = ">=3.6.2"
files = [
{file = "black-22.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2497f9c2386572e28921fa8bec7be3e51de6801f7459dffd6e62492531c47e09"},
{file = "black-22.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5795a0375eb87bfe902e80e0c8cfaedf8af4d49694d69161e5bd3206c18618bb"},
{file = "black-22.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e3556168e2e5c49629f7b0f377070240bd5511e45e25a4497bb0073d9dda776a"},
{file = "black-22.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67c8301ec94e3bcc8906740fe071391bce40a862b7be0b86fb5382beefecd968"},
{file = "black-22.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:fd57160949179ec517d32ac2ac898b5f20d68ed1a9c977346efbac9c2f1e779d"},
{file = "black-22.3.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc1e1de68c8e5444e8f94c3670bb48a2beef0e91dddfd4fcc29595ebd90bb9ce"},
{file = "black-22.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2fc92002d44746d3e7db7cf9313cf4452f43e9ea77a2c939defce3b10b5c82"},
{file = "black-22.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:a6342964b43a99dbc72f72812bf88cad8f0217ae9acb47c0d4f141a6416d2d7b"},
{file = "black-22.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:328efc0cc70ccb23429d6be184a15ce613f676bdfc85e5fe8ea2a9354b4e9015"},
{file = "black-22.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06f9d8846f2340dfac80ceb20200ea5d1b3f181dd0556b47af4e8e0b24fa0a6b"},
{file = "black-22.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:ad4efa5fad66b903b4a5f96d91461d90b9507a812b3c5de657d544215bb7877a"},
{file = "black-22.3.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8477ec6bbfe0312c128e74644ac8a02ca06bcdb8982d4ee06f209be28cdf163"},
{file = "black-22.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:637a4014c63fbf42a692d22b55d8ad6968a946b4a6ebc385c5505d9625b6a464"},
{file = "black-22.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:863714200ada56cbc366dc9ae5291ceb936573155f8bf8e9de92aef51f3ad0f0"},
{file = "black-22.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10dbe6e6d2988049b4655b2b739f98785a884d4d6b85bc35133a8fb9a2233176"},
{file = "black-22.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:cee3e11161dde1b2a33a904b850b0899e0424cc331b7295f2a9698e79f9a69a0"},
{file = "black-22.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5891ef8abc06576985de8fa88e95ab70641de6c1fca97e2a15820a9b69e51b20"},
{file = "black-22.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:30d78ba6bf080eeaf0b7b875d924b15cd46fec5fd044ddfbad38c8ea9171043a"},
{file = "black-22.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ee8f1f7228cce7dffc2b464f07ce769f478968bfb3dd1254a4c2eeed84928aad"},
{file = "black-22.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ee227b696ca60dd1c507be80a6bc849a5a6ab57ac7352aad1ffec9e8b805f21"},
{file = "black-22.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:9b542ced1ec0ceeff5b37d69838106a6348e60db7b8fdd245294dc1d26136265"},
{file = "black-22.3.0-py3-none-any.whl", hash = "sha256:bc58025940a896d7e5356952228b68f793cf5fcb342be703c3a2669a1488cb72"},
{file = "black-22.3.0.tar.gz", hash = "sha256:35020b8886c022ced9282b51b5a875b6d1ab0c387b31a065b84db7c33085ca79"},
python-versions = ">=3.8"
files = [
{file = "black-24.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6981eae48b3b33399c8757036c7f5d48a535b962a7c2310d19361edeef64ce29"},
{file = "black-24.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d533d5e3259720fdbc1b37444491b024003e012c5173f7d06825a77508085430"},
{file = "black-24.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61a0391772490ddfb8a693c067df1ef5227257e72b0e4108482b8d41b5aee13f"},
{file = "black-24.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:992e451b04667116680cb88f63449267c13e1ad134f30087dec8527242e9862a"},
{file = "black-24.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:163baf4ef40e6897a2a9b83890e59141cc8c2a98f2dda5080dc15c00ee1e62cd"},
{file = "black-24.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e37c99f89929af50ffaf912454b3e3b47fd64109659026b678c091a4cd450fb2"},
{file = "black-24.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9de21bafcba9683853f6c96c2d515e364aee631b178eaa5145fc1c61a3cc92"},
{file = "black-24.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:9db528bccb9e8e20c08e716b3b09c6bdd64da0dd129b11e160bf082d4642ac23"},
{file = "black-24.2.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d84f29eb3ee44859052073b7636533ec995bd0f64e2fb43aeceefc70090e752b"},
{file = "black-24.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e08fb9a15c914b81dd734ddd7fb10513016e5ce7e6704bdd5e1251ceee51ac9"},
{file = "black-24.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:810d445ae6069ce64030c78ff6127cd9cd178a9ac3361435708b907d8a04c693"},
{file = "black-24.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:ba15742a13de85e9b8f3239c8f807723991fbfae24bad92d34a2b12e81904982"},
{file = "black-24.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7e53a8c630f71db01b28cd9602a1ada68c937cbf2c333e6ed041390d6968faf4"},
{file = "black-24.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:93601c2deb321b4bad8f95df408e3fb3943d85012dddb6121336b8e24a0d1218"},
{file = "black-24.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0057f800de6acc4407fe75bb147b0c2b5cbb7c3ed110d3e5999cd01184d53b0"},
{file = "black-24.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:faf2ee02e6612577ba0181f4347bcbcf591eb122f7841ae5ba233d12c39dcb4d"},
{file = "black-24.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:057c3dc602eaa6fdc451069bd027a1b2635028b575a6c3acfd63193ced20d9c8"},
{file = "black-24.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:08654d0797e65f2423f850fc8e16a0ce50925f9337fb4a4a176a7aa4026e63f8"},
{file = "black-24.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca610d29415ee1a30a3f30fab7a8f4144e9d34c89a235d81292a1edb2b55f540"},
{file = "black-24.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:4dd76e9468d5536abd40ffbc7a247f83b2324f0c050556d9c371c2b9a9a95e31"},
{file = "black-24.2.0-py3-none-any.whl", hash = "sha256:e8a6ae970537e67830776488bca52000eaa37fa63b9988e8c487458d9cd5ace6"},
{file = "black-24.2.0.tar.gz", hash = "sha256:bce4f25c27c3435e4dace4815bcb2008b87e167e3bf4ee47ccdc5ce906eb4894"},
]
[package.dependencies]
click = ">=8.0.0"
mypy-extensions = ">=0.4.3"
packaging = ">=22.0"
pathspec = ">=0.9.0"
platformdirs = ">=2"
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""}
typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""}
[package.extras]
colorama = ["colorama (>=0.4.3)"]
d = ["aiohttp (>=3.7.4)"]
d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"]
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
uvloop = ["uvloop (>=0.15.2)"]
@ -237,13 +239,13 @@ click = "*"
[[package]]
name = "colorama"
version = "0.4.4"
version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
@ -388,6 +390,21 @@ files = [
{file = "demjson3-3.0.5.tar.gz", hash = "sha256:ab9aabdd85695f3684fc296f39766a2730f6c8de81d23f7048073dfe2f616d80"},
]
[[package]]
name = "dill"
version = "0.3.8"
description = "serialize all of Python"
optional = false
python-versions = ">=3.8"
files = [
{file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"},
{file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"},
]
[package.extras]
graph = ["objgraph (>=1.7.2)"]
profile = ["gprof2dot (>=2022.7.29)"]
[[package]]
name = "distlib"
version = "0.3.4"
@ -487,34 +504,37 @@ testing = ["covdefaults (>=1.2.0)", "coverage (>=4)", "pytest (>=4)", "pytest-co
[[package]]
name = "flake8"
version = "4.0.1"
version = "7.0.0"
description = "the modular source code checker: pep8 pyflakes and co"
optional = false
python-versions = ">=3.6"
python-versions = ">=3.8.1"
files = [
{file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"},
{file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"},
{file = "flake8-7.0.0-py2.py3-none-any.whl", hash = "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3"},
{file = "flake8-7.0.0.tar.gz", hash = "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132"},
]
[package.dependencies]
mccabe = ">=0.6.0,<0.7.0"
pycodestyle = ">=2.8.0,<2.9.0"
pyflakes = ">=2.4.0,<2.5.0"
mccabe = ">=0.7.0,<0.8.0"
pycodestyle = ">=2.11.0,<2.12.0"
pyflakes = ">=3.2.0,<3.3.0"
[[package]]
name = "flake8-requirements"
version = "1.5.2"
version = "2.1.0"
description = "Package requirements checker, plugin for flake8"
optional = false
python-versions = "*"
files = [
{file = "flake8_requirements-1.5.2-py2.py3-none-any.whl", hash = "sha256:3f511d17044e9185644c09cdb42fcaba7b6f285c978fb9ae2a8e468a50b73f61"},
{file = "flake8_requirements-2.1.0-py3-none-any.whl", hash = "sha256:a437e55c936542943bd532130772575f95690df1f57ad85191cec007d78a2f96"},
]
[package.dependencies]
flake8 = ">=2.0.0"
flake8 = ">=4.0.0"
setuptools = ">=10.0.0"
toml = ">=0.7.0"
tomli = {version = ">=1.2.1", markers = "python_version < \"3.11\""}
[package.extras]
pyproject = ["Flake8-pyproject"]
[[package]]
name = "flaky"
@ -833,13 +853,13 @@ files = [
[[package]]
name = "mccabe"
version = "0.6.1"
version = "0.7.0"
description = "McCabe checker, plugin for flake8"
optional = false
python-versions = "*"
python-versions = ">=3.6"
files = [
{file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"},
{file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"},
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
]
[[package]]
@ -913,18 +933,15 @@ files = [
[[package]]
name = "packaging"
version = "21.3"
version = "23.2"
description = "Core utilities for Python packages"
optional = false
python-versions = ">=3.6"
python-versions = ">=3.7"
files = [
{file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"},
{file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"},
{file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"},
{file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"},
]
[package.dependencies]
pyparsing = ">=2.0.2,<3.0.5 || >3.0.5"
[[package]]
name = "pathspec"
version = "0.9.0"
@ -1128,13 +1145,13 @@ files = [
[[package]]
name = "pycodestyle"
version = "2.8.0"
version = "2.11.1"
description = "Python style guide checker"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
python-versions = ">=3.8"
files = [
{file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"},
{file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"},
{file = "pycodestyle-2.11.1-py2.py3-none-any.whl", hash = "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"},
{file = "pycodestyle-2.11.1.tar.gz", hash = "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f"},
]
[[package]]
@ -1150,48 +1167,43 @@ files = [
[[package]]
name = "pyflakes"
version = "2.4.0"
version = "3.2.0"
description = "passive checker of Python programs"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
python-versions = ">=3.8"
files = [
{file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"},
{file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"},
{file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"},
{file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"},
]
[[package]]
name = "pylint"
version = "2.12.2"
version = "2.17.7"
description = "python code static checker"
optional = false
python-versions = ">=3.6.2"
python-versions = ">=3.7.2"
files = [
{file = "pylint-2.12.2-py3-none-any.whl", hash = "sha256:daabda3f7ed9d1c60f52d563b1b854632fd90035bcf01443e234d3dc794e3b74"},
{file = "pylint-2.12.2.tar.gz", hash = "sha256:9d945a73640e1fec07ee34b42f5669b770c759acd536ec7b16d7e4b87a9c9ff9"},
{file = "pylint-2.17.7-py3-none-any.whl", hash = "sha256:27a8d4c7ddc8c2f8c18aa0050148f89ffc09838142193fdbe98f172781a3ff87"},
{file = "pylint-2.17.7.tar.gz", hash = "sha256:f4fcac7ae74cfe36bc8451e931d8438e4a476c20314b1101c458ad0f05191fad"},
]
[package.dependencies]
astroid = ">=2.9.0,<2.10"
colorama = {version = "*", markers = "sys_platform == \"win32\""}
astroid = ">=2.15.8,<=2.17.0-dev0"
colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""}
dill = [
{version = ">=0.2", markers = "python_version < \"3.11\""},
{version = ">=0.3.6", markers = "python_version >= \"3.11\""},
]
isort = ">=4.2.5,<6"
mccabe = ">=0.6,<0.7"
mccabe = ">=0.6,<0.8"
platformdirs = ">=2.2.0"
toml = ">=0.9.2"
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
tomlkit = ">=0.10.1"
typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""}
[[package]]
name = "pyparsing"
version = "3.0.7"
description = "Python parsing module"
optional = false
python-versions = ">=3.6"
files = [
{file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"},
{file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"},
]
[package.extras]
diagrams = ["jinja2", "railroad-diagrams"]
spelling = ["pyenchant (>=3.2,<4.0)"]
testutils = ["gitpython (>3)"]
[[package]]
name = "pyserial"
@ -1528,6 +1540,17 @@ files = [
{file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"},
]
[[package]]
name = "tomlkit"
version = "0.12.4"
description = "Style preserving TOML library"
optional = false
python-versions = ">=3.7"
files = [
{file = "tomlkit-0.12.4-py3-none-any.whl", hash = "sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b"},
{file = "tomlkit-0.12.4.tar.gz", hash = "sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3"},
]
[[package]]
name = "towncrier"
version = "23.6.0"
@ -1697,62 +1720,81 @@ toml = "*"
[[package]]
name = "wrapt"
version = "1.13.3"
version = "1.16.0"
description = "Module for decorators, wrappers and monkey patching."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
python-versions = ">=3.6"
files = [
{file = "wrapt-1.13.3-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:e05e60ff3b2b0342153be4d1b597bbcfd8330890056b9619f4ad6b8d5c96a81a"},
{file = "wrapt-1.13.3-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:85148f4225287b6a0665eef08a178c15097366d46b210574a658c1ff5b377489"},
{file = "wrapt-1.13.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:2dded5496e8f1592ec27079b28b6ad2a1ef0b9296d270f77b8e4a3a796cf6909"},
{file = "wrapt-1.13.3-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:e94b7d9deaa4cc7bac9198a58a7240aaf87fe56c6277ee25fa5b3aa1edebd229"},
{file = "wrapt-1.13.3-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:498e6217523111d07cd67e87a791f5e9ee769f9241fcf8a379696e25806965af"},
{file = "wrapt-1.13.3-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:ec7e20258ecc5174029a0f391e1b948bf2906cd64c198a9b8b281b811cbc04de"},
{file = "wrapt-1.13.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:87883690cae293541e08ba2da22cacaae0a092e0ed56bbba8d018cc486fbafbb"},
{file = "wrapt-1.13.3-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:f99c0489258086308aad4ae57da9e8ecf9e1f3f30fa35d5e170b4d4896554d80"},
{file = "wrapt-1.13.3-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:6a03d9917aee887690aa3f1747ce634e610f6db6f6b332b35c2dd89412912bca"},
{file = "wrapt-1.13.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:936503cb0a6ed28dbfa87e8fcd0a56458822144e9d11a49ccee6d9a8adb2ac44"},
{file = "wrapt-1.13.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:f9c51d9af9abb899bd34ace878fbec8bf357b3194a10c4e8e0a25512826ef056"},
{file = "wrapt-1.13.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:220a869982ea9023e163ba915077816ca439489de6d2c09089b219f4e11b6785"},
{file = "wrapt-1.13.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:0877fe981fd76b183711d767500e6b3111378ed2043c145e21816ee589d91096"},
{file = "wrapt-1.13.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:43e69ffe47e3609a6aec0fe723001c60c65305784d964f5007d5b4fb1bc6bf33"},
{file = "wrapt-1.13.3-cp310-cp310-win32.whl", hash = "sha256:78dea98c81915bbf510eb6a3c9c24915e4660302937b9ae05a0947164248020f"},
{file = "wrapt-1.13.3-cp310-cp310-win_amd64.whl", hash = "sha256:ea3e746e29d4000cd98d572f3ee2a6050a4f784bb536f4ac1f035987fc1ed83e"},
{file = "wrapt-1.13.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:8c73c1a2ec7c98d7eaded149f6d225a692caa1bd7b2401a14125446e9e90410d"},
{file = "wrapt-1.13.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:086218a72ec7d986a3eddb7707c8c4526d677c7b35e355875a0fe2918b059179"},
{file = "wrapt-1.13.3-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:e92d0d4fa68ea0c02d39f1e2f9cb5bc4b4a71e8c442207433d8db47ee79d7aa3"},
{file = "wrapt-1.13.3-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:d4a5f6146cfa5c7ba0134249665acd322a70d1ea61732723c7d3e8cc0fa80755"},
{file = "wrapt-1.13.3-cp35-cp35m-win32.whl", hash = "sha256:8aab36778fa9bba1a8f06a4919556f9f8c7b33102bd71b3ab307bb3fecb21851"},
{file = "wrapt-1.13.3-cp35-cp35m-win_amd64.whl", hash = "sha256:944b180f61f5e36c0634d3202ba8509b986b5fbaf57db3e94df11abee244ba13"},
{file = "wrapt-1.13.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:2ebdde19cd3c8cdf8df3fc165bc7827334bc4e353465048b36f7deeae8ee0918"},
{file = "wrapt-1.13.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:610f5f83dd1e0ad40254c306f4764fcdc846641f120c3cf424ff57a19d5f7ade"},
{file = "wrapt-1.13.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5601f44a0f38fed36cc07db004f0eedeaadbdcec90e4e90509480e7e6060a5bc"},
{file = "wrapt-1.13.3-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:e6906d6f48437dfd80464f7d7af1740eadc572b9f7a4301e7dd3d65db285cacf"},
{file = "wrapt-1.13.3-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:766b32c762e07e26f50d8a3468e3b4228b3736c805018e4b0ec8cc01ecd88125"},
{file = "wrapt-1.13.3-cp36-cp36m-win32.whl", hash = "sha256:5f223101f21cfd41deec8ce3889dc59f88a59b409db028c469c9b20cfeefbe36"},
{file = "wrapt-1.13.3-cp36-cp36m-win_amd64.whl", hash = "sha256:f122ccd12fdc69628786d0c947bdd9cb2733be8f800d88b5a37c57f1f1d73c10"},
{file = "wrapt-1.13.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:46f7f3af321a573fc0c3586612db4decb7eb37172af1bc6173d81f5b66c2e068"},
{file = "wrapt-1.13.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:778fd096ee96890c10ce96187c76b3e99b2da44e08c9e24d5652f356873f6709"},
{file = "wrapt-1.13.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0cb23d36ed03bf46b894cfec777eec754146d68429c30431c99ef28482b5c1df"},
{file = "wrapt-1.13.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:96b81ae75591a795d8c90edc0bfaab44d3d41ffc1aae4d994c5aa21d9b8e19a2"},
{file = "wrapt-1.13.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7dd215e4e8514004c8d810a73e342c536547038fb130205ec4bba9f5de35d45b"},
{file = "wrapt-1.13.3-cp37-cp37m-win32.whl", hash = "sha256:47f0a183743e7f71f29e4e21574ad3fa95676136f45b91afcf83f6a050914829"},
{file = "wrapt-1.13.3-cp37-cp37m-win_amd64.whl", hash = "sha256:fd76c47f20984b43d93de9a82011bb6e5f8325df6c9ed4d8310029a55fa361ea"},
{file = "wrapt-1.13.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b73d4b78807bd299b38e4598b8e7bd34ed55d480160d2e7fdaabd9931afa65f9"},
{file = "wrapt-1.13.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ec9465dd69d5657b5d2fa6133b3e1e989ae27d29471a672416fd729b429eb554"},
{file = "wrapt-1.13.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:dd91006848eb55af2159375134d724032a2d1d13bcc6f81cd8d3ed9f2b8e846c"},
{file = "wrapt-1.13.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ae9de71eb60940e58207f8e71fe113c639da42adb02fb2bcbcaccc1ccecd092b"},
{file = "wrapt-1.13.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:51799ca950cfee9396a87f4a1240622ac38973b6df5ef7a41e7f0b98797099ce"},
{file = "wrapt-1.13.3-cp38-cp38-win32.whl", hash = "sha256:4b9c458732450ec42578b5642ac53e312092acf8c0bfce140ada5ca1ac556f79"},
{file = "wrapt-1.13.3-cp38-cp38-win_amd64.whl", hash = "sha256:7dde79d007cd6dfa65afe404766057c2409316135cb892be4b1c768e3f3a11cb"},
{file = "wrapt-1.13.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:981da26722bebb9247a0601e2922cedf8bb7a600e89c852d063313102de6f2cb"},
{file = "wrapt-1.13.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:705e2af1f7be4707e49ced9153f8d72131090e52be9278b5dbb1498c749a1e32"},
{file = "wrapt-1.13.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:25b1b1d5df495d82be1c9d2fad408f7ce5ca8a38085e2da41bb63c914baadff7"},
{file = "wrapt-1.13.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:77416e6b17926d953b5c666a3cb718d5945df63ecf922af0ee576206d7033b5e"},
{file = "wrapt-1.13.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:865c0b50003616f05858b22174c40ffc27a38e67359fa1495605f96125f76640"},
{file = "wrapt-1.13.3-cp39-cp39-win32.whl", hash = "sha256:0a017a667d1f7411816e4bf214646d0ad5b1da2c1ea13dec6c162736ff25a374"},
{file = "wrapt-1.13.3-cp39-cp39-win_amd64.whl", hash = "sha256:81bd7c90d28a4b2e1df135bfbd7c23aee3050078ca6441bead44c42483f9ebfb"},
{file = "wrapt-1.13.3.tar.gz", hash = "sha256:1fea9cd438686e6682271d36f3481a9f3636195578bab9ca3382e2f5f01fc185"},
{file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"},
{file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"},
{file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"},
{file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"},
{file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"},
{file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"},
{file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"},
{file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"},
{file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"},
{file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"},
{file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"},
{file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"},
{file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"},
{file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"},
{file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"},
{file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"},
{file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"},
{file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"},
{file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"},
{file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"},
{file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"},
{file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"},
{file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"},
{file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"},
{file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"},
{file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"},
{file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"},
{file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"},
{file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"},
{file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"},
{file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"},
{file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"},
{file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"},
{file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"},
{file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"},
{file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"},
{file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"},
{file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"},
{file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"},
{file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"},
{file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"},
{file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"},
{file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"},
{file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"},
{file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"},
{file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"},
{file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"},
{file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"},
{file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"},
{file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"},
{file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"},
{file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"},
{file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"},
{file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"},
{file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"},
{file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"},
{file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"},
{file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"},
{file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"},
{file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"},
{file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"},
{file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"},
{file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"},
{file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"},
{file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"},
{file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"},
{file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"},
{file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"},
{file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"},
{file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"},
]
[[package]]
@ -1787,5 +1829,5 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>=
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "72019b6396c9c15ee87968b735b954908a9e9e89d0c828b1e115293a0efb9f05"
python-versions = "^3.8.1"
content-hash = "47643781ef071c850a178d080e7263783dab694ad6bd562ca7028a0d11f109e9"

@ -6,7 +6,7 @@ authors = ["SatoshiLabs <info@satoshilabs.com>"]
[tool.poetry.dependencies]
# all
python = "^3.8"
python = "^3.8.1"
trezor = {path = "./python", develop = true}
scons = "*"
protobuf = "*"
@ -37,12 +37,12 @@ typing-extensions = ">=3.7.4"
## style
isort = "^5"
flake8 = ">=3.7.0"
black = ">=22.3"
flake8 = ">=7"
black = ">=24.2"
mako = "^1.0.7"
munch = "^2.3.2"
autoflake = "*"
flake8-requirements = ">=1.3.2"
flake8-requirements = ">=2.1.0"
pylint = "^2.11"
# common

@ -17,7 +17,9 @@ ignore =
E402,
# E501: line too long
E501,
# E741 ambiguous variable name
# E704: multiple statements on one line (def)
E704,
# E741: ambiguous variable name
E741,
# W503: line break before binary operator
W503

@ -234,17 +234,14 @@ class SignableImageProto(Protocol):
class CosiSignedImage(SignableImageProto, Protocol):
DEV_KEYS: t.ClassVar[t.Sequence[bytes]] = []
def insert_signature(self, signature: bytes, sigmask: int) -> None:
...
def insert_signature(self, signature: bytes, sigmask: int) -> None: ...
@runtime_checkable
class LegacySignedImage(SignableImageProto, Protocol):
def slots(self) -> t.Iterable[int]:
...
def slots(self) -> t.Iterable[int]: ...
def insert_signature(self, slot: int, key_index: int, signature: bytes) -> None:
...
def insert_signature(self, slot: int, key_index: int, signature: bytes) -> None: ...
def public_keys(
self, dev_keys: bool = False, signature_version: int = 3

@ -66,11 +66,9 @@ if TYPE_CHECKING:
vout: List[Vout]
class TxCacheType(Protocol):
def __getitem__(self, __key: bytes) -> messages.TransactionType:
...
def __getitem__(self, __key: bytes) -> messages.TransactionType: ...
def __contains__(self, __key: bytes) -> bool:
...
def __contains__(self, __key: bytes) -> bool: ...
def from_json(json_dict: "Transaction") -> messages.TransactionType:

@ -592,12 +592,14 @@ def parse_auxiliary_data(
staking_path=tools.parse_path(cvote_registration["staking_path"]),
nonce=cvote_registration["nonce"],
payment_address=cvote_registration.get("payment_address"),
payment_address_parameters=_parse_address_parameters(
cvote_registration["payment_address_parameters"],
str(AUXILIARY_DATA_MISSING_FIELDS_ERROR),
)
if "payment_address_parameters" in cvote_registration
else None,
payment_address_parameters=(
_parse_address_parameters(
cvote_registration["payment_address_parameters"],
str(AUXILIARY_DATA_MISSING_FIELDS_ERROR),
)
if "payment_address_parameters" in cvote_registration
else None
),
format=serialization_format,
delegations=delegations,
voting_purpose=voting_purpose,
@ -915,9 +917,9 @@ def sign_tx(
auxiliary_data_supplement.type
!= messages.CardanoTxAuxiliaryDataSupplementType.NONE
):
sign_tx_response[
"auxiliary_data_supplement"
] = auxiliary_data_supplement.__dict__
sign_tx_response["auxiliary_data_supplement"] = (
auxiliary_data_supplement.__dict__
)
response = client.call(messages.CardanoTxHostAck())
if not isinstance(response, messages.CardanoTxItemAck):

@ -154,9 +154,11 @@ def sign_tx(
"type": witness["type"],
"pub_key": witness["pub_key"].hex(),
"signature": witness["signature"].hex(),
"chain_code": witness["chain_code"].hex()
if witness["chain_code"] is not None
else None,
"chain_code": (
witness["chain_code"].hex()
if witness["chain_code"] is not None
else None
),
}
for witness in sign_tx_response["witnesses"]
]
@ -169,9 +171,9 @@ def sign_tx(
"cvote_registration_signature"
)
if cvote_registration_signature:
auxiliary_data_supplement[
"cvote_registration_signature"
] = cvote_registration_signature.hex()
auxiliary_data_supplement["cvote_registration_signature"] = (
cvote_registration_signature.hex()
)
sign_tx_response["auxiliary_data_supplement"] = auxiliary_data_supplement
return sign_tx_response

@ -565,12 +565,10 @@ class DebugLink:
# they will always return `LayoutContent` and we do not need to assert `is not None`.
@overload
def click(self, click: Tuple[int, int]) -> None:
...
def click(self, click: Tuple[int, int]) -> None: ...
@overload
def click(self, click: Tuple[int, int], wait: Literal[True]) -> LayoutContent:
...
def click(self, click: Tuple[int, int], wait: Literal[True]) -> LayoutContent: ...
def click(
self, click: Tuple[int, int], wait: bool = False
@ -602,34 +600,28 @@ class DebugLink:
return self.input(swipe=messages.DebugSwipeDirection.DOWN, wait=wait)
@overload
def swipe_right(self) -> None:
...
def swipe_right(self) -> None: ...
@overload
def swipe_right(self, wait: Literal[True]) -> LayoutContent:
...
def swipe_right(self, wait: Literal[True]) -> LayoutContent: ...
def swipe_right(self, wait: bool = False) -> Union[LayoutContent, None]:
return self.input(swipe=messages.DebugSwipeDirection.RIGHT, wait=wait)
@overload
def swipe_left(self) -> None:
...
def swipe_left(self) -> None: ...
@overload
def swipe_left(self, wait: Literal[True]) -> LayoutContent:
...
def swipe_left(self, wait: Literal[True]) -> LayoutContent: ...
def swipe_left(self, wait: bool = False) -> Union[LayoutContent, None]:
return self.input(swipe=messages.DebugSwipeDirection.LEFT, wait=wait)
@overload
def press_left(self) -> None:
...
def press_left(self) -> None: ...
@overload
def press_left(self, wait: Literal[True]) -> LayoutContent:
...
def press_left(self, wait: Literal[True]) -> LayoutContent: ...
def press_left(self, wait: bool = False) -> Optional[LayoutContent]:
return self.input(
@ -637,12 +629,10 @@ class DebugLink:
)
@overload
def press_middle(self) -> None:
...
def press_middle(self) -> None: ...
@overload
def press_middle(self, wait: Literal[True]) -> LayoutContent:
...
def press_middle(self, wait: Literal[True]) -> LayoutContent: ...
def press_middle(self, wait: bool = False) -> Optional[LayoutContent]:
return self.input(
@ -659,12 +649,10 @@ class DebugLink:
)
@overload
def press_right(self) -> None:
...
def press_right(self) -> None: ...
@overload
def press_right(self, wait: Literal[True]) -> LayoutContent:
...
def press_right(self, wait: Literal[True]) -> LayoutContent: ...
def press_right(self, wait: bool = False) -> Optional[LayoutContent]:
return self.input(
@ -892,7 +880,7 @@ class MessageFilter:
return cls(type(message), **fields)
def match(self, message: protobuf.MessageType) -> bool:
if type(message) != self.message_type:
if type(message) is not self.message_type:
return False
for field, expected_value in self.fields.items():

@ -44,14 +44,11 @@ if t.TYPE_CHECKING:
class FirmwareType(Protocol):
@classmethod
def parse(cls: t.Type[T], data: bytes) -> T:
...
def parse(cls: t.Type[T], data: bytes) -> T: ...
def verify(self, dev_keys: bool = False) -> None:
...
def verify(self, dev_keys: bool = False) -> None: ...
def digest(self) -> bytes:
...
def digest(self) -> bytes: ...
def parse(data: bytes) -> "FirmwareType":

@ -33,11 +33,9 @@ class Unsigned(FirmwareIntegrityError):
class DigestCalculator(Protocol):
def update(self, __data: bytes) -> None:
...
def update(self, __data: bytes) -> None: ...
def digest(self) -> bytes:
...
def digest(self) -> bytes: ...
Hasher = t.Callable[[bytes], DigestCalculator]

@ -244,15 +244,13 @@ def prepare_message_bytes(txt: AnyStr) -> bytes:
@overload
def expect(
expected: "Type[MT]",
) -> "Callable[[Callable[P, MessageType]], Callable[P, MT]]":
...
) -> "Callable[[Callable[P, MessageType]], Callable[P, MT]]": ...
@overload
def expect(
expected: "Type[MT]", *, field: str, ret_type: "Type[R]"
) -> "Callable[[Callable[P, MessageType]], Callable[P, R]]":
...
) -> "Callable[[Callable[P, MessageType]], Callable[P, R]]": ...
def expect(

@ -44,17 +44,13 @@ class Handle(StructuralType):
but don't have to, inherit from it.
"""
def open(self) -> None:
...
def open(self) -> None: ...
def close(self) -> None:
...
def close(self) -> None: ...
def read_chunk(self) -> bytes:
...
def read_chunk(self) -> bytes: ...
def write_chunk(self, chunk: bytes) -> None:
...
def write_chunk(self, chunk: bytes) -> None: ...
class Protocol:

@ -63,14 +63,11 @@ CAN_HANDLE_HIDDEN_INPUT = sys.stdin and sys.stdin.isatty()
class TrezorClientUI(Protocol):
def button_request(self, br: messages.ButtonRequest) -> None:
...
def button_request(self, br: messages.ButtonRequest) -> None: ...
def get_pin(self, code: Optional[PinMatrixRequestType]) -> str:
...
def get_pin(self, code: Optional[PinMatrixRequestType]) -> str: ...
def get_passphrase(self, available_on_device: bool) -> Union[str, object]:
...
def get_passphrase(self, available_on_device: bool) -> Union[str, object]: ...
def echo(*args: Any, **kwargs: Any) -> None:

@ -323,7 +323,7 @@ def test_recursive():
assert msg == retr
assert retr.uvarint == 1
assert type(retr.recursivefield) == RecursiveMessage
assert type(retr.recursivefield) is RecursiveMessage
assert retr.recursivefield.uvarint == 2
assert type(retr.recursivefield.recursivefield) == RecursiveMessage
assert type(retr.recursivefield.recursivefield) is RecursiveMessage
assert retr.recursivefield.recursivefield.uvarint == 3

@ -10,7 +10,9 @@ ignore =
E402,
# E501: line too long
E501,
# E741 ambiguous variable name
# E704: multiple statements on one line (def)
E704,
# E741: ambiguous variable name
E741,
# W503: line break before binary operator
W503,

@ -61,12 +61,14 @@ def test_cardano_get_address(client: Client, chunkify: bool, parameters, result)
address_type=getattr(
CardanoAddressType, parameters["address_type"].upper()
),
address_n=parse_path(parameters.get("path"))
if "path" in parameters
else None,
address_n_staking=parse_path(parameters.get("staking_path"))
if "staking_path" in parameters
else None,
address_n=(
parse_path(parameters.get("path")) if "path" in parameters else None
),
address_n_staking=(
parse_path(parameters.get("staking_path"))
if "staking_path" in parameters
else None
),
staking_key_hash=parse_optional_bytes(parameters.get("staking_key_hash")),
block_index=parameters.get("block_index"),
tx_index=parameters.get("tx_index"),

@ -151,9 +151,11 @@ def _transform_expected_result(result):
"type": witness["type"],
"pub_key": bytes.fromhex(witness["pub_key"]),
"signature": bytes.fromhex(witness["signature"]),
"chain_code": bytes.fromhex(witness["chain_code"])
if witness["chain_code"]
else None,
"chain_code": (
bytes.fromhex(witness["chain_code"])
if witness["chain_code"]
else None
),
}
for witness in result["witnesses"]
],

@ -42,9 +42,9 @@ def make_token(
def make_payload(
data_type: messages.EthereumDefinitionType = messages.EthereumDefinitionType.NETWORK,
timestamp: int = 0xFFFF_FFFF,
message: messages.EthereumNetworkInfo
| messages.EthereumTokenInfo
| bytes = make_network(),
message: (
messages.EthereumNetworkInfo | messages.EthereumTokenInfo | bytes
) = make_network(),
) -> bytes:
if isinstance(message, bytes):
message_bytes = message

@ -52,9 +52,11 @@ def test_ethereum_sign_typed_data_blind(client: Client, parameters, result):
address_n,
ethereum.decode_hex(parameters["domain_separator_hash"]),
# message hash is empty for domain-only hashes
ethereum.decode_hex(parameters["message_hash"])
if parameters["message_hash"]
else None,
(
ethereum.decode_hex(parameters["message_hash"])
if parameters["message_hash"]
else None
),
)
assert ret.address == result["address"]
assert f"0x{ret.signature.hex()}" == result["sig"]

@ -51,21 +51,23 @@ def test_solana_sign_tx(client: Client, parameters, result):
client,
address_n=parse_path(parameters["address"]),
serialized_tx=serialized_tx,
additional_info=messages.SolanaTxAdditionalInfo(
token_accounts_infos=[
messages.SolanaTxTokenAccountInfo(
base_address=token_account["base_address"],
token_program=token_account["token_program"],
token_mint=token_account["token_mint"],
token_account=token_account["token_account"],
)
for token_account in parameters["additional_info"][
"token_accounts_infos"
additional_info=(
messages.SolanaTxAdditionalInfo(
token_accounts_infos=[
messages.SolanaTxTokenAccountInfo(
base_address=token_account["base_address"],
token_program=token_account["token_program"],
token_mint=token_account["token_mint"],
token_account=token_account["token_account"],
)
for token_account in parameters["additional_info"][
"token_accounts_infos"
]
]
]
)
if "additional_info" in parameters
else None,
)
if "additional_info" in parameters
else None
),
)
assert actual_result.signature == bytes.fromhex(result["expected_signature"])

Loading…
Cancel
Save