1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-24 17:58:45 +00:00

style: fix linter complaints

This commit is contained in:
matejcik 2025-04-29 12:12:56 +02:00 committed by matejcik
parent ff1c9b9f9a
commit 17990e1c80
7 changed files with 18 additions and 11 deletions

View File

@ -1,6 +1,5 @@
from typing import TYPE_CHECKING
from trezor.crypto import base58
from trezor.wire import DataError
from apps.common.keychain import with_slip44_keychain

View File

@ -309,10 +309,10 @@ class Transaction:
SOLANA_TOKEN_ACCOUNT_SIZE,
)
from ..transaction.instructions import (
is_system_program_account_creation,
is_atap_account_creation,
_TOKEN_2022_PROGRAM_ID,
_TOKEN_PROGRAM_ID,
is_atap_account_creation,
is_system_program_account_creation,
)
allocation = 0

View File

@ -1,3 +1,5 @@
from __future__ import annotations
import json
from typing import TYPE_CHECKING, Optional, TextIO

View File

@ -9,8 +9,8 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path
from ...input_flows import InputFlowConfirmAllWarnings
from ... import definitions
from ...input_flows import InputFlowConfirmAllWarnings
from .test_sign_typed_data import DATA as TYPED_DATA
pytestmark = [pytest.mark.altcoin, pytest.mark.ethereum]
@ -65,7 +65,9 @@ def test_slip44_external(client: Client) -> None:
network = definitions.encode_eth_network(chain_id=66666, slip44=66666)
params = DEFAULT_TX_PARAMS.copy()
params.update(n=parse_path("m/44h/66666h/0h/0/0"), chain_id=66666)
ethereum.sign_tx(client, **params, definitions=definitions.make_eth_defs(network, None))
ethereum.sign_tx(
client, **params, definitions=definitions.make_eth_defs(network, None)
)
def test_slip44_external_disallowed(client: Client) -> None:
@ -121,10 +123,14 @@ def test_builtin_token(client: Client) -> None:
def test_external_token(client: Client) -> None:
# A valid token definition must be provided to use a non-builtin token
token = definitions.encode_eth_token(address=ERC20_FAKE_ADDRESS, chain_id=1, decimals=8)
token = definitions.encode_eth_token(
address=ERC20_FAKE_ADDRESS, chain_id=1, decimals=8
)
params = DEFAULT_ERC20_PARAMS.copy()
params.update(to=ERC20_FAKE_ADDRESS)
ethereum.sign_tx(client, **params, definitions=definitions.make_eth_defs(None, token))
ethereum.sign_tx(
client, **params, definitions=definitions.make_eth_defs(None, token)
)
# TODO check that FakeTok symbol is shown

View File

@ -13,8 +13,8 @@ from trezorlib.tools import parse_path
from ...definitions import (
make_eth_defs,
make_eth_network,
make_payload,
make_eth_token,
make_payload,
sign_payload,
)
from .test_definitions import DEFAULT_ERC20_PARAMS, ERC20_FAKE_ADDRESS

View File

@ -23,6 +23,7 @@ from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path, unharden
from ...common import parametrize_using_common_fixtures
from ...definitions import encode_eth_network
from ...input_flows import (
InputFlowConfirmAllWarnings,
InputFlowEthereumSignTxDataGoBack,
@ -32,7 +33,6 @@ from ...input_flows import (
InputFlowEthereumSignTxShowFeeInfo,
InputFlowEthereumSignTxStaking,
)
from ...definitions import encode_eth_network
TO_ADDR = "0x1d1c328764a41bda0492b66baa30c4a339ff85ef"

View File

@ -19,13 +19,13 @@ import pytest
from trezorlib import messages
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.solana import sign_tx
from trezorlib.tools import parse_path, b58decode
from trezorlib.tools import b58decode, parse_path
from ...common import parametrize_using_common_fixtures
from ...definitions import encode_solana_token
from ...input_flows import InputFlowConfirmAllWarnings
from .construct.instructions import PROGRAMS, UnknownInstruction
from .construct.transaction import Message, RawInstruction
from ...definitions import encode_solana_token
pytestmark = [
pytest.mark.altcoin,