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:
parent
ff1c9b9f9a
commit
17990e1c80
@ -1,6 +1,5 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from trezor.crypto import base58
|
|
||||||
from trezor.wire import DataError
|
from trezor.wire import DataError
|
||||||
|
|
||||||
from apps.common.keychain import with_slip44_keychain
|
from apps.common.keychain import with_slip44_keychain
|
||||||
|
@ -309,10 +309,10 @@ class Transaction:
|
|||||||
SOLANA_TOKEN_ACCOUNT_SIZE,
|
SOLANA_TOKEN_ACCOUNT_SIZE,
|
||||||
)
|
)
|
||||||
from ..transaction.instructions import (
|
from ..transaction.instructions import (
|
||||||
is_system_program_account_creation,
|
|
||||||
is_atap_account_creation,
|
|
||||||
_TOKEN_2022_PROGRAM_ID,
|
_TOKEN_2022_PROGRAM_ID,
|
||||||
_TOKEN_PROGRAM_ID,
|
_TOKEN_PROGRAM_ID,
|
||||||
|
is_atap_account_creation,
|
||||||
|
is_system_program_account_creation,
|
||||||
)
|
)
|
||||||
|
|
||||||
allocation = 0
|
allocation = 0
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import TYPE_CHECKING, Optional, TextIO
|
from typing import TYPE_CHECKING, Optional, TextIO
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client
|
|||||||
from trezorlib.exceptions import TrezorFailure
|
from trezorlib.exceptions import TrezorFailure
|
||||||
from trezorlib.tools import parse_path
|
from trezorlib.tools import parse_path
|
||||||
|
|
||||||
from ...input_flows import InputFlowConfirmAllWarnings
|
|
||||||
from ... import definitions
|
from ... import definitions
|
||||||
|
from ...input_flows import InputFlowConfirmAllWarnings
|
||||||
from .test_sign_typed_data import DATA as TYPED_DATA
|
from .test_sign_typed_data import DATA as TYPED_DATA
|
||||||
|
|
||||||
pytestmark = [pytest.mark.altcoin, pytest.mark.ethereum]
|
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)
|
network = definitions.encode_eth_network(chain_id=66666, slip44=66666)
|
||||||
params = DEFAULT_TX_PARAMS.copy()
|
params = DEFAULT_TX_PARAMS.copy()
|
||||||
params.update(n=parse_path("m/44h/66666h/0h/0/0"), chain_id=66666)
|
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:
|
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:
|
def test_external_token(client: Client) -> None:
|
||||||
# A valid token definition must be provided to use a non-builtin token
|
# 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 = DEFAULT_ERC20_PARAMS.copy()
|
||||||
params.update(to=ERC20_FAKE_ADDRESS)
|
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
|
# TODO check that FakeTok symbol is shown
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ from trezorlib.tools import parse_path
|
|||||||
from ...definitions import (
|
from ...definitions import (
|
||||||
make_eth_defs,
|
make_eth_defs,
|
||||||
make_eth_network,
|
make_eth_network,
|
||||||
make_payload,
|
|
||||||
make_eth_token,
|
make_eth_token,
|
||||||
|
make_payload,
|
||||||
sign_payload,
|
sign_payload,
|
||||||
)
|
)
|
||||||
from .test_definitions import DEFAULT_ERC20_PARAMS, ERC20_FAKE_ADDRESS
|
from .test_definitions import DEFAULT_ERC20_PARAMS, ERC20_FAKE_ADDRESS
|
||||||
|
@ -23,6 +23,7 @@ from trezorlib.exceptions import TrezorFailure
|
|||||||
from trezorlib.tools import parse_path, unharden
|
from trezorlib.tools import parse_path, unharden
|
||||||
|
|
||||||
from ...common import parametrize_using_common_fixtures
|
from ...common import parametrize_using_common_fixtures
|
||||||
|
from ...definitions import encode_eth_network
|
||||||
from ...input_flows import (
|
from ...input_flows import (
|
||||||
InputFlowConfirmAllWarnings,
|
InputFlowConfirmAllWarnings,
|
||||||
InputFlowEthereumSignTxDataGoBack,
|
InputFlowEthereumSignTxDataGoBack,
|
||||||
@ -32,7 +33,6 @@ from ...input_flows import (
|
|||||||
InputFlowEthereumSignTxShowFeeInfo,
|
InputFlowEthereumSignTxShowFeeInfo,
|
||||||
InputFlowEthereumSignTxStaking,
|
InputFlowEthereumSignTxStaking,
|
||||||
)
|
)
|
||||||
from ...definitions import encode_eth_network
|
|
||||||
|
|
||||||
TO_ADDR = "0x1d1c328764a41bda0492b66baa30c4a339ff85ef"
|
TO_ADDR = "0x1d1c328764a41bda0492b66baa30c4a339ff85ef"
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ import pytest
|
|||||||
from trezorlib import messages
|
from trezorlib import messages
|
||||||
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
||||||
from trezorlib.solana import sign_tx
|
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 ...common import parametrize_using_common_fixtures
|
||||||
|
from ...definitions import encode_solana_token
|
||||||
from ...input_flows import InputFlowConfirmAllWarnings
|
from ...input_flows import InputFlowConfirmAllWarnings
|
||||||
from .construct.instructions import PROGRAMS, UnknownInstruction
|
from .construct.instructions import PROGRAMS, UnknownInstruction
|
||||||
from .construct.transaction import Message, RawInstruction
|
from .construct.transaction import Message, RawInstruction
|
||||||
from ...definitions import encode_solana_token
|
|
||||||
|
|
||||||
pytestmark = [
|
pytestmark = [
|
||||||
pytest.mark.altcoin,
|
pytest.mark.altcoin,
|
||||||
|
Loading…
Reference in New Issue
Block a user