mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +00:00
tests: update device_tests for external definitions
This commit is contained in:
parent
abbe5535ad
commit
e2d600389b
18
common/tests/fixtures/ethereum/getaddress.json
vendored
18
common/tests/fixtures/ethereum/getaddress.json
vendored
@ -45,24 +45,6 @@
|
||||
"address": "0xF410e37E9C8BCf8CF319c84Ae9dCEbe057804a04"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GoChain",
|
||||
"parameters": {
|
||||
"path": "m/44'/6060'/0'/0/0"
|
||||
},
|
||||
"result": {
|
||||
"address": "0xA26a450ef46a5f11a510eBA2119A3236fa0Aca92"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Wanchain",
|
||||
"parameters": {
|
||||
"path": "m/44'/5718350'/0'/0/0"
|
||||
},
|
||||
"result": {
|
||||
"address": "0xe432a7533D689ceed00B7EE91d9368b8A1693bD2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Ledger Live legacy path",
|
||||
"parameters": {
|
||||
|
22
common/tests/fixtures/ethereum/sign_tx.json
vendored
22
common/tests/fixtures/ethereum/sign_tx.json
vendored
@ -5,27 +5,7 @@
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"name": "known_erc20_token",
|
||||
"parameters": {
|
||||
"comment": "Sending 200,000,000 ADT tokens to address 0x574bbb36871ba6b78e27f4b4dcfb76ea0091880b",
|
||||
"data": "a9059cbb000000000000000000000000574bbb36871ba6b78e27f4b4dcfb76ea0091880b000000000000000000000000000000000000000000000000000000000bebc200",
|
||||
"path": "m/44'/60'/0'/0/0",
|
||||
"to_address": "0xd0d6d6c5fe4a677d343cc433536bb717bae167dd",
|
||||
"chain_id": 1,
|
||||
"nonce": "0x0",
|
||||
"gas_price": "0x14",
|
||||
"gas_limit": "0x14",
|
||||
"tx_type": null,
|
||||
"value": "0x0"
|
||||
},
|
||||
"result": {
|
||||
"sig_v": 37,
|
||||
"sig_r": "ec1df922115d256745410fbc2070296756583c8786e4d402a88d4e29ec513fa9",
|
||||
"sig_s": "7001bfe3ba357e4a9f9e0d3a3f8a8962257615a4cf215db93e48b98999fc51b7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unknown_erc20_token",
|
||||
"name": "erc20_token",
|
||||
"parameters": {
|
||||
"comment": "Sending 291 Grzegorz Brzęczyszczykiewicz tokens to address 0x574bbb36871ba6b78e27f4b4dcfb76ea0091880b",
|
||||
"data": "a9059cbb000000000000000000000000574bbb36871ba6b78e27f4b4dcfb76ea0091880b0000000000000000000000000000000000000000000000000000000000000123",
|
||||
|
@ -62,27 +62,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "known_erc20",
|
||||
"parameters": {
|
||||
"comment": "Sending 200,000,000 ADT tokens to address 0x574bbb36871ba6b78e27f4b4dcfb76ea0091880b",
|
||||
"data": "a9059cbb000000000000000000000000574bbb36871ba6b78e27f4b4dcfb76ea0091880b000000000000000000000000000000000000000000000000000000000bebc200",
|
||||
"path": "m/44'/60'/0'/0/0",
|
||||
"to_address": "0xd0d6d6c5fe4a677d343cc433536bb717bae167dd",
|
||||
"chain_id": 1,
|
||||
"nonce": "0x0",
|
||||
"gas_limit": "0x14",
|
||||
"max_gas_fee": "0x14",
|
||||
"max_priority_fee": "0x1",
|
||||
"value": "0x0"
|
||||
},
|
||||
"result": {
|
||||
"sig_v": 1,
|
||||
"sig_r": "94d67bacb7966f881339d91103f5d738d9c491fff4c01a6513c554ab15e86cc0",
|
||||
"sig_s": "405bd19a7bf4ae62d41fcb7844e36c786b106b456185c3d0877a7ce7eab6c751"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unknown_erc20",
|
||||
"name": "erc20",
|
||||
"parameters": {
|
||||
"comment": "Sending 291 Grzegorz Brzęczyszczykiewicz tokens to address 0x574bbb36871ba6b78e27f4b4dcfb76ea0091880b",
|
||||
"data": "a9059cbb000000000000000000000000574bbb36871ba6b78e27f4b4dcfb76ea0091880b0000000000000000000000000000000000000000000000000000000000000123",
|
||||
|
145
tests/device_tests/ethereum/common.py
Normal file
145
tests/device_tests/ethereum/common.py
Normal file
@ -0,0 +1,145 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import io
|
||||
import typing as t
|
||||
from hashlib import sha256
|
||||
|
||||
from trezorlib import cosi, definitions, messages, protobuf
|
||||
|
||||
PRIVATE_KEYS_DEV = [byte * 32 for byte in (b"\xdd", b"\xde", b"\xdf")]
|
||||
|
||||
|
||||
def sign_with_privkeys(digest: bytes, privkeys: t.Sequence[bytes]) -> bytes:
|
||||
"""Locally produce a CoSi signature."""
|
||||
pubkeys = [cosi.pubkey_from_privkey(sk) for sk in privkeys]
|
||||
nonces = [cosi.get_nonce(sk, digest, i) for i, sk in enumerate(privkeys)]
|
||||
|
||||
global_pk = cosi.combine_keys(pubkeys)
|
||||
global_R = cosi.combine_keys(R for _, R in nonces)
|
||||
|
||||
sigs = [
|
||||
cosi.sign_with_privkey(digest, sk, global_pk, r, global_R)
|
||||
for sk, (r, _) in zip(privkeys, nonces)
|
||||
]
|
||||
|
||||
return cosi.combine_sig(global_R, sigs)
|
||||
|
||||
|
||||
def make_network(
|
||||
chain_id: int = 0,
|
||||
slip44: int = 0,
|
||||
symbol: str = "FAKE",
|
||||
name: str = "Fake network",
|
||||
) -> messages.EthereumNetworkInfo:
|
||||
return messages.EthereumNetworkInfo(
|
||||
chain_id=chain_id,
|
||||
slip44=slip44,
|
||||
symbol=symbol,
|
||||
name=name,
|
||||
)
|
||||
|
||||
|
||||
def make_token(
|
||||
symbol: str = "FAKE",
|
||||
decimals: int = 18,
|
||||
address: bytes = b"",
|
||||
chain_id: int = 0,
|
||||
name: str = "Fake token",
|
||||
) -> messages.EthereumTokenInfo:
|
||||
return messages.EthereumTokenInfo(
|
||||
symbol=symbol,
|
||||
decimals=decimals,
|
||||
address=address,
|
||||
chain_id=chain_id,
|
||||
name=name,
|
||||
)
|
||||
|
||||
|
||||
def make_payload(
|
||||
data_type: messages.EthereumDefinitionType = messages.EthereumDefinitionType.NETWORK,
|
||||
timestamp: int = 0xFFFF_FFFF,
|
||||
message: messages.EthereumNetworkInfo
|
||||
| messages.EthereumTokenInfo
|
||||
| bytes = make_network(),
|
||||
) -> bytes:
|
||||
if isinstance(message, bytes):
|
||||
message_bytes = message
|
||||
else:
|
||||
writer = io.BytesIO()
|
||||
protobuf.dump_message(writer, message)
|
||||
message_bytes = writer.getvalue()
|
||||
|
||||
payload = definitions.DefinitionPayload(
|
||||
magic=b"trzd1",
|
||||
data_type=data_type,
|
||||
timestamp=timestamp,
|
||||
data=message_bytes,
|
||||
)
|
||||
return payload.build()
|
||||
|
||||
|
||||
def sign_payload(
|
||||
payload: bytes,
|
||||
merkle_neighbors: list[bytes],
|
||||
threshold: int = 3,
|
||||
) -> tuple[bytes, bytes]:
|
||||
digest = sha256(b"\x00" + payload).digest()
|
||||
merkle_proof = []
|
||||
for item in merkle_neighbors:
|
||||
left, right = min(digest, item), max(digest, item)
|
||||
digest = sha256(b"\x01" + left + right).digest()
|
||||
merkle_proof.append(digest)
|
||||
|
||||
merkle_proof = len(merkle_proof).to_bytes(1, "little") + b"".join(merkle_proof)
|
||||
signature = sign_with_privkeys(digest, PRIVATE_KEYS_DEV[:threshold])
|
||||
sigmask = 0
|
||||
for i in range(threshold):
|
||||
sigmask |= 1 << i
|
||||
sigmask_byte = sigmask.to_bytes(1, "little")
|
||||
return merkle_proof, sigmask_byte + signature
|
||||
|
||||
|
||||
def encode_network(
|
||||
network: messages.EthereumNetworkInfo | None = None,
|
||||
chain_id: int = 0,
|
||||
slip44: int = 0,
|
||||
symbol: str = "FAKE",
|
||||
name: str = "Fake network",
|
||||
) -> bytes:
|
||||
if network is None:
|
||||
network = make_network(chain_id, slip44, symbol, name)
|
||||
payload = make_payload(
|
||||
data_type=messages.EthereumDefinitionType.NETWORK, message=network
|
||||
)
|
||||
proof, signature = sign_payload(payload, [])
|
||||
return payload + proof + signature
|
||||
|
||||
|
||||
def encode_token(
|
||||
token: messages.EthereumTokenInfo | None = None,
|
||||
symbol: str = "FakeTok",
|
||||
decimals: int = 18,
|
||||
address: t.AnyStr = b"",
|
||||
chain_id: int = 0,
|
||||
name: str = "Fake token",
|
||||
) -> bytes:
|
||||
if token is None:
|
||||
if isinstance(address, str):
|
||||
if address.startswith("0x"):
|
||||
address = address[2:]
|
||||
address = bytes.fromhex(address) # type: ignore (typechecker is lying)
|
||||
token = make_token(symbol, decimals, address, chain_id, name) # type: ignore (typechecker is lying)
|
||||
payload = make_payload(
|
||||
data_type=messages.EthereumDefinitionType.TOKEN, message=token
|
||||
)
|
||||
proof, signature = sign_payload(payload, [])
|
||||
return payload + proof + signature
|
||||
|
||||
|
||||
def make_defs(
|
||||
network: bytes | None, token: bytes | None
|
||||
) -> messages.EthereumDefinitions:
|
||||
return messages.EthereumDefinitions(
|
||||
encoded_network=network,
|
||||
encoded_token=token,
|
||||
)
|
231
tests/device_tests/ethereum/test_definitions.py
Normal file
231
tests/device_tests/ethereum/test_definitions.py
Normal file
@ -0,0 +1,231 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Callable
|
||||
|
||||
import pytest
|
||||
|
||||
from trezorlib import ethereum
|
||||
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
||||
from trezorlib.exceptions import TrezorFailure
|
||||
from trezorlib.tools import parse_path
|
||||
|
||||
from . import common
|
||||
from .test_sign_typed_data import DATA as TYPED_DATA
|
||||
|
||||
pytestmark = [pytest.mark.altcoin, pytest.mark.ethereum]
|
||||
|
||||
ERC20_OPERATION = "a9059cbb000000000000000000000000574bbb36871ba6b78e27f4b4dcfb76ea0091880b0000000000000000000000000000000000000000000000000000000000000123"
|
||||
ERC20_BUILTIN_TOKEN = "0xdac17f958d2ee523a2206206994597c13d831ec7" # USDT
|
||||
ERC20_FAKE_ADDRESS = "0xdddddddddddddddddddddddddddddddddddddddd"
|
||||
|
||||
DEFAULT_TX_PARAMS = {
|
||||
"nonce": 0x0,
|
||||
"gas_price": 0x4A817C800,
|
||||
"gas_limit": 0x5208,
|
||||
"value": 0x2540BE400,
|
||||
"to": "0x1d1c328764a41bda0492b66baa30c4a339ff85ef",
|
||||
"chain_id": 1,
|
||||
"n": parse_path("m/44h/60h/0h/0/0"),
|
||||
}
|
||||
|
||||
DEFAULT_ERC20_PARAMS = {
|
||||
"nonce": 0x0,
|
||||
"gas_price": 0x4A817C800,
|
||||
"gas_limit": 0x5208,
|
||||
"value": 0x0,
|
||||
"chain_id": 1,
|
||||
"n": parse_path("m/44h/60h/0h/0/0"),
|
||||
"data": bytes.fromhex(ERC20_OPERATION),
|
||||
}
|
||||
|
||||
|
||||
def test_builtin(client: Client) -> None:
|
||||
# Ethereum (SLIP-44 60, chain_id 1) will sign without any definitions provided
|
||||
ethereum.sign_tx(client, **DEFAULT_TX_PARAMS)
|
||||
|
||||
|
||||
def test_chain_id_allowed(client: Client) -> None:
|
||||
# Any chain id is allowed as long as the SLIP44 stays the same
|
||||
params = DEFAULT_TX_PARAMS.copy()
|
||||
params.update(chain_id=222222)
|
||||
ethereum.sign_tx(client, **params)
|
||||
|
||||
|
||||
def test_slip44_disallowed(client: Client) -> None:
|
||||
# SLIP44 is not allowed without a valid network definition
|
||||
params = DEFAULT_TX_PARAMS.copy()
|
||||
params.update(n=parse_path("m/44h/66666h/0h/0/0"))
|
||||
with pytest.raises(TrezorFailure, match="Forbidden key path"):
|
||||
ethereum.sign_tx(client, **params)
|
||||
|
||||
|
||||
def test_slip44_external(client: Client) -> None:
|
||||
# to use a non-default SLIP44, a valid network definition must be provided
|
||||
network = common.encode_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=common.make_defs(network, None))
|
||||
|
||||
|
||||
def test_slip44_external_disallowed(client: Client) -> None:
|
||||
# network definition does not allow a different SLIP44
|
||||
network = common.encode_network(chain_id=66666, slip44=66666)
|
||||
params = DEFAULT_TX_PARAMS.copy()
|
||||
params.update(n=parse_path("m/44h/55555h/0h/0/0"), chain_id=66666)
|
||||
with pytest.raises(TrezorFailure, match="Forbidden key path"):
|
||||
ethereum.sign_tx(client, **params, definitions=common.make_defs(network, None))
|
||||
|
||||
|
||||
def test_chain_id_mismatch(client: Client) -> None:
|
||||
# network definition for a different chain id will be rejected
|
||||
network = common.encode_network(chain_id=66666, slip44=60)
|
||||
params = DEFAULT_TX_PARAMS.copy()
|
||||
params.update(chain_id=55555)
|
||||
with pytest.raises(TrezorFailure, match="Network definition mismatch"):
|
||||
ethereum.sign_tx(client, **params, definitions=common.make_defs(network, None))
|
||||
|
||||
|
||||
def test_definition_does_not_override_builtin(client: Client) -> None:
|
||||
# The builtin definition for Ethereum (SLIP44 60, chain_id 1) will be used
|
||||
# even if a valid definition with a different SLIP44 is provided
|
||||
network = common.encode_network(chain_id=1, slip44=66666)
|
||||
params = DEFAULT_TX_PARAMS.copy()
|
||||
params.update(n=parse_path("m/44h/66666h/0h/0/0"), chain_id=1)
|
||||
with pytest.raises(TrezorFailure, match="Forbidden key path"):
|
||||
ethereum.sign_tx(client, **params, definitions=common.make_defs(network, None))
|
||||
|
||||
# TODO: test that the builtin definition will not show different symbol
|
||||
|
||||
|
||||
# TODO: figure out how to test acceptance of a token definition
|
||||
# all tokens are currently accepted, we would need to check the screenshots
|
||||
|
||||
|
||||
def test_builtin_token(client: Client) -> None:
|
||||
# The builtin definition for USDT (ERC20) will be used even if not provided
|
||||
params = DEFAULT_ERC20_PARAMS.copy()
|
||||
params.update(to=ERC20_BUILTIN_TOKEN)
|
||||
ethereum.sign_tx(client, **params)
|
||||
# TODO check that USDT symbol is shown
|
||||
|
||||
|
||||
# TODO: test_builtin_token_not_overriden (builtin definition is used even if a custom one is provided)
|
||||
|
||||
|
||||
def test_external_token(client: Client) -> None:
|
||||
# A valid token definition must be provided to use a non-builtin token
|
||||
token = common.encode_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=common.make_defs(None, token))
|
||||
# TODO check that FakeTok symbol is shown
|
||||
|
||||
|
||||
def test_external_chain_without_token(client: Client) -> None:
|
||||
# when using an external chains, unknown tokens are allowed
|
||||
network = common.encode_network(chain_id=66666, slip44=60)
|
||||
params = DEFAULT_ERC20_PARAMS.copy()
|
||||
params.update(to=ERC20_BUILTIN_TOKEN, chain_id=66666)
|
||||
ethereum.sign_tx(client, **params, definitions=common.make_defs(network, None))
|
||||
# TODO check that UNKN token is used, FAKE network
|
||||
|
||||
|
||||
def test_external_chain_token_ok(client: Client) -> None:
|
||||
# when providing an external chain and matching token, everything works
|
||||
network = common.encode_network(chain_id=66666, slip44=60)
|
||||
token = common.encode_token(address=ERC20_FAKE_ADDRESS, chain_id=66666, decimals=8)
|
||||
params = DEFAULT_ERC20_PARAMS.copy()
|
||||
params.update(to=ERC20_FAKE_ADDRESS, chain_id=66666)
|
||||
ethereum.sign_tx(client, **params, definitions=common.make_defs(network, token))
|
||||
# TODO check that FakeTok is used, FAKE network
|
||||
|
||||
|
||||
def test_external_chain_token_mismatch(client: Client) -> None:
|
||||
# when providing external defs, we explicitly allow, but not use, tokens
|
||||
# from other chains
|
||||
network = common.encode_network(chain_id=66666, slip44=60)
|
||||
token = common.encode_token(address=ERC20_FAKE_ADDRESS, chain_id=55555, decimals=8)
|
||||
params = DEFAULT_ERC20_PARAMS.copy()
|
||||
params.update(to=ERC20_FAKE_ADDRESS, chain_id=66666)
|
||||
ethereum.sign_tx(client, **params, definitions=common.make_defs(network, token))
|
||||
# TODO check that UNKN is used for token, FAKE for network
|
||||
|
||||
|
||||
def _call_getaddress(client: Client, slip44: int, network: bytes | None) -> None:
|
||||
ethereum.get_address(
|
||||
client,
|
||||
parse_path(f"m/44h/{slip44}h/0h"),
|
||||
show_display=False,
|
||||
encoded_network=network,
|
||||
)
|
||||
|
||||
|
||||
def _call_signmessage(client: Client, slip44: int, network: bytes | None) -> None:
|
||||
ethereum.sign_message(
|
||||
client,
|
||||
parse_path(f"m/44h/{slip44}h/0h"),
|
||||
b"hello",
|
||||
encoded_network=network,
|
||||
)
|
||||
|
||||
|
||||
def _call_sign_typed_data(client: Client, slip44: int, network: bytes | None) -> None:
|
||||
ethereum.sign_typed_data(
|
||||
client,
|
||||
parse_path(f"m/44h/{slip44}h/0h/0/0"),
|
||||
TYPED_DATA,
|
||||
metamask_v4_compat=True,
|
||||
definitions=common.make_defs(network, None),
|
||||
)
|
||||
|
||||
|
||||
def _call_sign_typed_data_hash(
|
||||
client: Client, slip44: int, network: bytes | None
|
||||
) -> None:
|
||||
ethereum.sign_typed_data_hash(
|
||||
client,
|
||||
parse_path(f"m/44h/{slip44}h/0h/0/0"),
|
||||
b"\x00" * 32,
|
||||
b"\xff" * 32,
|
||||
encoded_network=network,
|
||||
)
|
||||
|
||||
|
||||
MethodType = Callable[[Client, int, "bytes | None"], None]
|
||||
|
||||
|
||||
METHODS = (
|
||||
_call_getaddress,
|
||||
_call_signmessage,
|
||||
pytest.param(_call_sign_typed_data, marks=pytest.mark.skip_t1),
|
||||
pytest.param(_call_sign_typed_data_hash, marks=pytest.mark.skip_t2),
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method", METHODS)
|
||||
def test_method_builtin(client: Client, method: MethodType) -> None:
|
||||
# calling a method with a builtin slip44 will work
|
||||
method(client, 60, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method", METHODS)
|
||||
def test_method_def_missing(client: Client, method: MethodType) -> None:
|
||||
# calling a method with a slip44 that has no definition will fail
|
||||
with pytest.raises(TrezorFailure, match="Forbidden key path"):
|
||||
method(client, 66666, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method", METHODS)
|
||||
def test_method_external(client: Client, method: MethodType) -> None:
|
||||
# calling a method with a slip44 that has an external definition will work
|
||||
network = common.encode_network(slip44=66666)
|
||||
method(client, 66666, network)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method", METHODS)
|
||||
def test_method_external_mismatch(client: Client, method: MethodType) -> None:
|
||||
# calling a method with a slip44 that has an external definition that does not match
|
||||
# the slip44 will fail
|
||||
network = common.encode_network(slip44=77777)
|
||||
with pytest.raises(TrezorFailure, match="Network definition mismatch"):
|
||||
method(client, 66666, network)
|
131
tests/device_tests/ethereum/test_definitions_bad.py
Normal file
131
tests/device_tests/ethereum/test_definitions_bad.py
Normal file
@ -0,0 +1,131 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from hashlib import sha256
|
||||
|
||||
import pytest
|
||||
|
||||
from trezorlib import ethereum
|
||||
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
||||
from trezorlib.exceptions import TrezorFailure
|
||||
from trezorlib.messages import EthereumDefinitionType
|
||||
from trezorlib.tools import parse_path
|
||||
|
||||
from .common import make_defs, make_network, make_payload, make_token, sign_payload
|
||||
from .test_definitions import DEFAULT_ERC20_PARAMS, ERC20_FAKE_ADDRESS
|
||||
|
||||
pytestmark = [pytest.mark.altcoin, pytest.mark.ethereum]
|
||||
|
||||
|
||||
def fails(client: Client, network: bytes, match: str) -> None:
|
||||
with pytest.raises(TrezorFailure, match=match):
|
||||
ethereum.get_address(
|
||||
client,
|
||||
parse_path("m/44h/666666h/0h"),
|
||||
show_display=False,
|
||||
encoded_network=network,
|
||||
)
|
||||
|
||||
|
||||
def test_short_message(client: Client) -> None:
|
||||
fails(client, b"\x00", "Invalid Ethereum definition")
|
||||
|
||||
|
||||
def test_mangled_signature(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, signature = sign_payload(payload, [])
|
||||
bad_signature = signature[:-1] + b"\xff"
|
||||
fails(client, payload + proof + bad_signature, "Invalid definition signature")
|
||||
|
||||
|
||||
def test_not_enough_signatures(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, signature = sign_payload(payload, [], threshold=1)
|
||||
fails(client, payload + proof + signature, "Invalid definition signature")
|
||||
|
||||
|
||||
def test_missing_signature(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, _ = sign_payload(payload, [])
|
||||
fails(client, payload + proof, "Invalid Ethereum definition")
|
||||
|
||||
|
||||
def test_mangled_payload(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, signature = sign_payload(payload, [])
|
||||
bad_payload = payload[:-1] + b"\xff"
|
||||
fails(client, bad_payload + proof + signature, "Invalid definition signature")
|
||||
|
||||
|
||||
def test_proof_length_mismatch(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
_, signature = sign_payload(payload, [])
|
||||
bad_proof = b"\x01"
|
||||
fails(client, payload + bad_proof + signature, "Invalid Ethereum definition")
|
||||
|
||||
|
||||
def test_bad_proof(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, signature = sign_payload(payload, [sha256(b"x").digest()])
|
||||
bad_proof = proof[:-1] + b"\xff"
|
||||
fails(client, payload + bad_proof + signature, "Invalid definition signature")
|
||||
|
||||
|
||||
def test_trimmed_proof(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, signature = sign_payload(payload, [])
|
||||
bad_proof = proof[:-1]
|
||||
fails(client, payload + bad_proof + signature, "Invalid Ethereum definition")
|
||||
|
||||
|
||||
def test_bad_prefix(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
payload = b"trzd2" + payload[5:]
|
||||
proof, signature = sign_payload(payload, [])
|
||||
fails(client, payload + proof + signature, "Invalid Ethereum definition")
|
||||
|
||||
|
||||
def test_bad_type(client: Client) -> None:
|
||||
# assuming we expect a network definition
|
||||
payload = make_payload(data_type=EthereumDefinitionType.TOKEN, message=make_token())
|
||||
proof, signature = sign_payload(payload, [])
|
||||
fails(client, payload + proof + signature, "Definition type mismatch")
|
||||
|
||||
|
||||
def test_outdated(client: Client) -> None:
|
||||
payload = make_payload(timestamp=0)
|
||||
proof, signature = sign_payload(payload, [])
|
||||
fails(client, payload + proof + signature, "Definition is outdated")
|
||||
|
||||
|
||||
def test_malformed_protobuf(client: Client) -> None:
|
||||
payload = make_payload(message=b"\x00")
|
||||
proof, signature = sign_payload(payload, [])
|
||||
fails(client, payload + proof + signature, "Invalid Ethereum definition")
|
||||
|
||||
|
||||
def test_protobuf_mismatch(client: Client) -> None:
|
||||
payload = make_payload(
|
||||
data_type=EthereumDefinitionType.NETWORK, message=make_token()
|
||||
)
|
||||
proof, signature = sign_payload(payload, [])
|
||||
fails(client, payload + proof + signature, "Invalid Ethereum definition")
|
||||
|
||||
payload = make_payload(
|
||||
data_type=EthereumDefinitionType.TOKEN, message=make_network()
|
||||
)
|
||||
proof, signature = sign_payload(payload, [])
|
||||
# have to do this manually to invoke a method that eats token definitions
|
||||
with pytest.raises(TrezorFailure, match="Invalid Ethereum definition"):
|
||||
params = DEFAULT_ERC20_PARAMS.copy()
|
||||
params.update(to=ERC20_FAKE_ADDRESS)
|
||||
ethereum.sign_tx(
|
||||
client,
|
||||
**params,
|
||||
definitions=make_defs(None, payload + proof + signature),
|
||||
)
|
||||
|
||||
|
||||
def test_trailing_garbage(client: Client) -> None:
|
||||
payload = make_payload()
|
||||
proof, signature = sign_payload(payload, [])
|
||||
fails(client, payload + proof + signature + b"\x00", "Invalid Ethereum definition")
|
@ -19,9 +19,10 @@ import pytest
|
||||
from trezorlib import ethereum, exceptions, messages
|
||||
from trezorlib.debuglink import TrezorClientDebugLink as Client, message_filters
|
||||
from trezorlib.exceptions import TrezorFailure
|
||||
from trezorlib.tools import parse_path
|
||||
from trezorlib.tools import parse_path, unharden
|
||||
|
||||
from ...common import parametrize_using_common_fixtures
|
||||
from .common import encode_network
|
||||
|
||||
TO_ADDR = "0x1d1c328764a41bda0492b66baa30c4a339ff85ef"
|
||||
SHOW_ALL = (143, 167)
|
||||
@ -30,6 +31,17 @@ GO_BACK = (16, 220)
|
||||
pytestmark = [pytest.mark.altcoin, pytest.mark.ethereum]
|
||||
|
||||
|
||||
def make_defs(parameters: dict) -> messages.EthereumDefinitions:
|
||||
# With removal of most built-in defs from firmware, we have test vectors
|
||||
# that no longer run. Because this is not the place to test the definitions,
|
||||
# we generate fake entries so that we can check the signing results.
|
||||
address_n = parse_path(parameters["path"])
|
||||
slip44 = unharden(address_n[1])
|
||||
network = encode_network(chain_id=parameters["chain_id"], slip44=slip44)
|
||||
|
||||
return messages.EthereumDefinitions(encoded_network=network)
|
||||
|
||||
|
||||
@parametrize_using_common_fixtures(
|
||||
"ethereum/sign_tx.json",
|
||||
"ethereum/sign_tx_eip155.json",
|
||||
@ -47,6 +59,7 @@ def test_signtx(client: Client, parameters, result):
|
||||
value=int(parameters["value"], 16),
|
||||
tx_type=parameters["tx_type"],
|
||||
data=bytes.fromhex(parameters["data"]),
|
||||
definitions=make_defs(parameters),
|
||||
)
|
||||
|
||||
expected_v = 2 * parameters["chain_id"] + 35
|
||||
@ -70,6 +83,7 @@ def test_signtx_eip1559(client: Client, parameters, result):
|
||||
chain_id=parameters["chain_id"],
|
||||
value=int(parameters["value"], 16),
|
||||
data=bytes.fromhex(parameters["data"]),
|
||||
definitions=make_defs(parameters),
|
||||
)
|
||||
|
||||
assert sig_r.hex() == result["sig_r"]
|
||||
|
@ -360,10 +360,46 @@
|
||||
"T1_bitcoin-test_zcash.py::test_spend_old_versions": "d86d753fa98cc9a99fd635bb57e14e0cae500cab6199b0ba1d501fa4eca6a63e",
|
||||
"T1_bitcoin-test_zcash.py::test_v3_not_supported": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_bitcoin-test_zcash.py::test_version_group_id_missing": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_builtin": "d88cf848ef5ba25c4545f817db565b5a020f47cfd56453c930f62a3b2721cd2f",
|
||||
"T1_ethereum-test_definitions.py::test_builtin_token": "918bc7c30de63b9778e9a97cd3e84424f85f777216285dc8d624d5d56497a954",
|
||||
"T1_ethereum-test_definitions.py::test_chain_id_allowed": "cd3c38d2f2b1158846a646a3a589d651b8b81ad05018909b3bd9607e9a272de4",
|
||||
"T1_ethereum-test_definitions.py::test_chain_id_mismatch": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_definition_does_not_override_builtin": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_external_chain_token_mismatch": "3dbb91414205db65140c6cf9b347c5a17fcc72207da62027ed1781c2142433ac",
|
||||
"T1_ethereum-test_definitions.py::test_external_chain_token_ok": "98e80bde52f40cefe33b8e16db3f38942035614913362168cb0e946a9ab5c856",
|
||||
"T1_ethereum-test_definitions.py::test_external_chain_without_token": "3dbb91414205db65140c6cf9b347c5a17fcc72207da62027ed1781c2142433ac",
|
||||
"T1_ethereum-test_definitions.py::test_external_token": "b224ca172240ccb336fadaff42dbee3985afc865111ac25d2d89ac51f4e7f9fe",
|
||||
"T1_ethereum-test_definitions.py::test_method_builtin[_call_getaddress]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_builtin[_call_sign_typed_data_hash]": "306b42e936a0c6c48f5ae556fe4d7612c63c45b73dc6a3830f12922b70c50330",
|
||||
"T1_ethereum-test_definitions.py::test_method_builtin[_call_signmessage]": "59aaee443a05ad617bd7d112e9a8e75379e5464bb4238f9253d6f1e7e4f097dc",
|
||||
"T1_ethereum-test_definitions.py::test_method_def_missing[_call_getaddress]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_def_missing[_call_sign_typed_data_hash]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_def_missing[_call_signmessage]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_external[_call_getaddress]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_external[_call_sign_typed_data_hash]": "8f7b33550d98bb2abf54271e9a435dd3d8371d4aaf03194a9dad8162ecfcb832",
|
||||
"T1_ethereum-test_definitions.py::test_method_external[_call_signmessage]": "0b690024cdc6bc88d2eacf70a91287b691ef9ac7d8a9555281a9fa5155397a0a",
|
||||
"T1_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data_hash]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_slip44_disallowed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions.py::test_slip44_external": "ee68e40f34c86d20860b593d5551d4826cadb3d6c1f26d3c2bd53952595463fe",
|
||||
"T1_ethereum-test_definitions.py::test_slip44_external_disallowed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_bad_prefix": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_bad_proof": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_bad_type": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_malformed_protobuf": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_mangled_payload": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_mangled_signature": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_missing_signature": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_not_enough_signatures": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_outdated": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_proof_length_mismatch": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_protobuf_mismatch": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_short_message": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_trailing_garbage": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_definitions_bad.py::test_trimmed_proof": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[ETC]": "efe11a5e9959ba001e33298ec4e00c4f224e325bd41fd713cf01192ac4dfb01a",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[GoChain]": "1382242f4ee598a076b4ce007d63262a420cb38a0871e4679596ff61f2503197",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[Ledger Live legacy path]": "16ccd6cf4421b1002d479f9ca633ac1ee8dca0fa3f1339fa66380d14e5109e2a",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[Wanchain]": "ebaac4910879f20082df6b2755533ecbbd41d60d75bc86f181aa6c740fdba033",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[parameters0-result0]": "a229f91ee8c13470faa74e086d582032072f8f2e3a38cf5e9941bef634abb626",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[parameters1-result1]": "5eaa807f7ac37df989696049a1a5e19751f0c32b7541167e88f56a7aff353f42",
|
||||
"T1_ethereum-test_getaddress.py::test_getaddress[parameters2-result2]": "d2f4a0194a0dfeb082daec10639c0489ebe30389d7baf1a26dfe20538421592a",
|
||||
@ -402,36 +438,34 @@
|
||||
"T1_ethereum-test_signtx.py::test_data_streaming": "058a66e82bb733d5c5c687b5537887022acfd7401bb0b5aa4a12f6f35b209239",
|
||||
"T1_ethereum-test_signtx.py::test_sanity_checks": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_signtx.py::test_sanity_checks_eip1559": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Auxilium]": "05d5ac917c9d3032fb4658b7f502748b412ffe435fc788c62733e00b948da5f7",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Auxilium]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[ETC]": "05b7842c03625104ae3459a55097bc96e878eca465bf69ea2691407868e5dd4b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Ethereum]": "90feef1fdcd162209a948c127df638c09bee0444fee40f2d30dbff21658d83ef",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Ledger Live legacy path0]": "37aa64fbab44b89757833df6ee78e302c97fe24c4cb74175f1843f635cb2dbec",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Ledger Live legacy path1]": "90feef1fdcd162209a948c127df638c09bee0444fee40f2d30dbff21658d83ef",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Palm]": "9d3f44b5d6089919a9e50c3344e5210bdf4a127db33d91b4eeaf93403acb5578",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Pirl]": "159bb61626157fa11dbd7775d09b95af8b1269432ed83a649a04e700d944aa02",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Palm]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Pirl]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Rinkeby]": "937894301354c759d2221ed56286e7df6c6696fa4be3d61846cb3307fd428d21",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Ropsten]": "937894301354c759d2221ed56286e7df6c6696fa4be3d61846cb3307fd428d21",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_eth_path]": "a6e6d63cba839c897e80dc0b7cf5c2263be8ff64a5281a43fca992380cca872b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_testnet_path]": "a6e6d63cba839c897e80dc0b7cf5c2263be8ff64a5281a43fca992380cca872b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_eth_path]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_testnet_path]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[data_1]": "8b432aba21bc4344814cceaf693e114b9d3e3d6ceb83c3a6af7c3ed0f9b37449",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[data_2_bigdata]": "445286b7501ca67dd16dafd7ea09c57cc4a37a642ae50f0c812d74353c37c017",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[known_erc20_token]": "7ef8d3bbf6e299b41522769a893f72b04571fc7176bc93e5c1701a2b5721fb20",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[max_chain_id]": "a6e6d63cba839c897e80dc0b7cf5c2263be8ff64a5281a43fca992380cca872b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[max_chain_plus_one]": "a6e6d63cba839c897e80dc0b7cf5c2263be8ff64a5281a43fca992380cca872b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[erc20_token]": "d797c970429f1e974a69b9f5bd814a4f13f15b1b5d6ab1c117e65b919a434cf9",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[max_chain_id]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[max_chain_plus_one]": "4552f9a68c62613e1ef7df68c1f47f7d4888c4505f0586012b71c07acba1fbcb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[max_uint64]": "a6e6d63cba839c897e80dc0b7cf5c2263be8ff64a5281a43fca992380cca872b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[newcontract]": "a7efa7f690d1448dc48f642f69688e8b266417901cc014e5930c94c9087b3e08",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[nodata_1]": "6bd90f2c98122de19159e60fd4dcf9f4b16a600407ac84ea1e447d561ea9decb",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[nodata_2_bigvalue]": "538f7be885ce6ea3a6dc842ef10797fa45184d7737f6f179c42d36fe92fadd45",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[unknown_erc20_token]": "df41efe4c5336fc188d3f754d2fe0b830588e57eaa32c98607b0bc4057851fcc",
|
||||
"T1_ethereum-test_signtx.py::test_signtx[wanchain]": "37aa64fbab44b89757833df6ee78e302c97fe24c4cb74175f1843f635cb2dbec",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[Ledger Live legacy path]": "5b008a081b4ef9e7b47c9d0c1fc4bb24d729d77841193694232bd2da4a386515",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[data_1]": "171ffadf61a2520274bedf6a8543127f23a8948c2689e034f996e170289b1822",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[data_2_bigdata]": "28d2a0d397b4e9865ca8286cc1a3669c3a7d34bb31b430662354bf3ec69d1cc5",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[known_erc20]": "b8e205a40711e377f2185cec6e085fa2f6a4d5bbc6a03d9cf2758058b6c1e17b",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[erc20]": "4b97bba97b14f40c36a793e8a842d5c6fd13c4465b4d3b47b96bab943eb649f3",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[large_chainid]": "5b008a081b4ef9e7b47c9d0c1fc4bb24d729d77841193694232bd2da4a386515",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[long_fees]": "ef84e6b4ae6ff0b4c9d22a4b6356c8c67affbf28882e83cef4aea6e93b4bdcf5",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[nodata]": "5b008a081b4ef9e7b47c9d0c1fc4bb24d729d77841193694232bd2da4a386515",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559[unknown_erc20]": "548c1f22918351e9cbcc1e16d8ba67bc2e7460b9a92cfc6c8bfa0a2b063e68da",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559_access_list": "f6c5f398d4e80fc8f93cf70e9b10de24b9a968db04dc6ea21b28d1a273f04ca1",
|
||||
"T1_ethereum-test_signtx.py::test_signtx_eip1559_access_list_larger": "f6c5f398d4e80fc8f93cf70e9b10de24b9a968db04dc6ea21b28d1a273f04ca1",
|
||||
"T1_misc-test_cosi.py::test_cosi_nonce": "6990c238036b79368fea1dc1e3e8871d7788322bbee7425d14c53623bc8182e8",
|
||||
@ -1399,10 +1433,46 @@
|
||||
"TT_eos-test_signtx.py::test_eos_signtx_updateauth": "e3f408a6dc73c86113f7e0d3edba362ab652c21771624ee43eb9e721582169c3",
|
||||
"TT_eos-test_signtx.py::test_eos_signtx_vote": "652dc7e1f452c9907a2be4f9c58e0e94e68f694a082e1704b9e9ea303e6dcf06",
|
||||
"TT_eos-test_signtx.py::test_eos_signtx_vote_proxy": "659a087b4cffcbcb0785685264250fc3a8fae54764a7c16988b4464b27e0c194",
|
||||
"TT_ethereum-test_definitions.py::test_builtin": "1f1f89bc7682c0eca29eb9239b2a4c4de7c92fa5abd532df5251b7c7184631f8",
|
||||
"TT_ethereum-test_definitions.py::test_builtin_token": "98f55944842bf2ed265fd68563d27a3564f5b8b9a782b13d9a434ff46ed95aa6",
|
||||
"TT_ethereum-test_definitions.py::test_chain_id_allowed": "89f7e628525e4ce02391782755677db2807d0fad8d81d6105a9a982ff5cf152c",
|
||||
"TT_ethereum-test_definitions.py::test_chain_id_mismatch": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_definition_does_not_override_builtin": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_external_chain_token_mismatch": "5fd23f1e3e69ccba8ef168d35c0de5a74d2b7b58805743e81a2f836bd058780d",
|
||||
"TT_ethereum-test_definitions.py::test_external_chain_token_ok": "31860a9c885d8eef9757fbc5f2eb8c162229a8498c35338088eb410720479358",
|
||||
"TT_ethereum-test_definitions.py::test_external_chain_without_token": "a08fd3c410590f1a648c979315b6a04157e01cb32c489f2a781f0a08b967f138",
|
||||
"TT_ethereum-test_definitions.py::test_external_token": "11fb78853572702f09e12513a921196485375e3381a99631ce83bdb274a392a2",
|
||||
"TT_ethereum-test_definitions.py::test_method_builtin[_call_getaddress]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_builtin[_call_sign_typed_data]": "6e4b23328381f4f251b8811a35bb37b423c66bbb1011046a1696300dc975d0f6",
|
||||
"TT_ethereum-test_definitions.py::test_method_builtin[_call_signmessage]": "81432428efdd9cd492619471bd86f692dda92db91f606f75a176c5a67600c303",
|
||||
"TT_ethereum-test_definitions.py::test_method_def_missing[_call_getaddress]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_def_missing[_call_sign_typed_data]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_def_missing[_call_signmessage]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_external[_call_getaddress]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_external[_call_sign_typed_data]": "a1ef5d1f82a996d8acf606f74726e142bde54c178b5a4cdcb76b726cbc28e8dd",
|
||||
"TT_ethereum-test_definitions.py::test_method_external[_call_signmessage]": "c5228a275933a9bfa0b504ec1278c9d016f8c9cdfa8a6a6ec3fc350109ed5c18",
|
||||
"TT_ethereum-test_definitions.py::test_method_external_mismatch[_call_getaddress]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_external_mismatch[_call_sign_typed_data]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_method_external_mismatch[_call_signmessage]": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_slip44_disallowed": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions.py::test_slip44_external": "3b55af88fa10d6c71fcba5c918f9ed78afc19242676a8a7cfb56eb3f94824588",
|
||||
"TT_ethereum-test_definitions.py::test_slip44_external_disallowed": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_bad_prefix": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_bad_proof": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_bad_type": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_malformed_protobuf": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_mangled_payload": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_mangled_signature": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_missing_signature": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_not_enough_signatures": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_outdated": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_proof_length_mismatch": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_protobuf_mismatch": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_short_message": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_trailing_garbage": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_definitions_bad.py::test_trimmed_proof": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[ETC]": "6f26e25959f1508929d30929dd67fd4d8085ee0522a51a05345690dacecd3119",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[GoChain]": "843898752798328fa9ba2740a78b6cf4eadde908e20f8354f7e600a18bfffff6",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[Ledger Live legacy path]": "a747e033eb82c9e28b78a6fcd4c93a82f7aa422221fb277e51e7067736cec207",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[Wanchain]": "983e0ffb81b320861cb573ae47b760ff3cb189c26080e9fd3a1b9527e0992f56",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[parameters0-result0]": "a102b225d74a69cb1b10be5fd66254a38fe6f03d1c26a88e2b54a2ee8b84e2f2",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[parameters1-result1]": "3c334d7dc4890df577cfc4922edb42945f6ab1cd4f252ae12f29515209d53b5d",
|
||||
"TT_ethereum-test_getaddress.py::test_getaddress[parameters2-result2]": "fec876b1cdf434a548b0961bf598f88845ae7086bd4c6bc038f3687e09ae692d",
|
||||
@ -1443,39 +1513,37 @@
|
||||
"TT_ethereum-test_signtx.py::test_data_streaming": "37b57deb4bebbb0b2ac938e37aa7a9c33a7dbccdcfcca6b5606e875486b0cdbf",
|
||||
"TT_ethereum-test_signtx.py::test_sanity_checks": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_signtx.py::test_sanity_checks_eip1559": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Auxilium]": "c3f121684c33c095fe4df292fc7f339c972e2c8d9b9b2834872e7d4dad7e1936",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Auxilium]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[ETC]": "d2821f3ae03d280ce0236bfaacfcf86347b9ec4db16bc693d42493446275b37c",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Ethereum]": "de080fa4ed1460796ae10a6807979da0e3988ef2572f76807843bc3bc80aff98",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Ledger Live legacy path0]": "ace16be01942abb698eb6c3979db0a0b9ff717bfa97fdd203bad180a61529d4c",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Ledger Live legacy path1]": "de080fa4ed1460796ae10a6807979da0e3988ef2572f76807843bc3bc80aff98",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Palm]": "664ffc62a4c83dad85c5112a2291c671f6592f135819e52f27aa75e6fadcd0f2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Pirl]": "8bdd6aebc2874f00a050ef405e13e332e97ab1f09b352de7563c676d064e4ab2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Palm]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Pirl]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Rinkeby]": "ab9d8984c582bd3e7e9bb73a8d3c3e0dd78378f6c3ee0583d4380fd39c5608e6",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Ropsten]": "ab9d8984c582bd3e7e9bb73a8d3c3e0dd78378f6c3ee0583d4380fd39c5608e6",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_eth_path]": "4950ca1e7735c200993e57a43894cf5aa083221dfd2631e4c8bb0741f6d0a1f2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_testnet_path]": "4950ca1e7735c200993e57a43894cf5aa083221dfd2631e4c8bb0741f6d0a1f2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_eth_path]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[Unknown_chain_id_testnet_path]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[data_1]": "115334e46d7d5437b059827983bf306c9f896e9c2c4e2bdcc607036161a2484c",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[data_2_bigdata]": "de82160d53cef7d21cf89aa821d967de71462701ab65e53cc46c76ae329a0b13",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[known_erc20_token]": "7d7b76994921f556caddaf02227f1d05a5f54b12011ca3e3ac913f28a6da9ee0",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[max_chain_id]": "4950ca1e7735c200993e57a43894cf5aa083221dfd2631e4c8bb0741f6d0a1f2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[max_chain_plus_one]": "4950ca1e7735c200993e57a43894cf5aa083221dfd2631e4c8bb0741f6d0a1f2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[max_uint64]": "4950ca1e7735c200993e57a43894cf5aa083221dfd2631e4c8bb0741f6d0a1f2",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[erc20_token]": "d8caacabb30216f289f8ded087159a186f08d531b778ee107ddeb70147319779",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[max_chain_id]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[max_chain_plus_one]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[max_uint64]": "6ee2528a8f2fc02a5cbd626cf22aa45b0d744403a6e2dbe6d2cbe4bb81ad292a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[newcontract]": "6fb5c72c8d682b39d04795989a54bc7401ad95a244b4b3c3933b15c7eda60bf8",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[nodata_1]": "be9fd7dd4e6bc5202052e220feb1b149e09ba9ba3459bbc0039a05f05b8702fb",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[nodata_2_bigvalue]": "f9af32cc8ad624a7770f47db01f49d3cebe550dd709e36d7d2770e44d728fd5c",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[unknown_erc20_token]": "d8caacabb30216f289f8ded087159a186f08d531b778ee107ddeb70147319779",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[wanchain]": "a680c055a31d426d0436f50ff41439c1c197a15bc7fa0dc79b4f1b33e86c0284",
|
||||
"TT_ethereum-test_signtx.py::test_signtx[wanchain]": "5dc4c88049c0ec4fc7fa068adedd232f47764a3beb8e44e9a6c1aee612e73e1f",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_data_pagination[input_flow_go_back]": "52a7a2ba3c4a8819ce141a4da583908b1a999c3dc10918a43d62d0d6351a0ec8",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_data_pagination[input_flow_scroll_down]": "6d4e91dd6fa6eff311deab71d321680efdae195468fe802f43d6774316808d31",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_data_pagination[input_flow_skip]": "4f39e94891387b7b4bd1e7b704511ba8afeb02aef657807f9a35edda06ea31db",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[Ledger Live legacy path]": "62854c008d12948c388c267ca66c7e25bdc5e245988267e4a1237d643dba21f5",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[data_1]": "f70a7494aec21c14e41a6856ba50ebc3d70dcac4da925882955820619eb85073",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[data_2_bigdata]": "4a2f154fc53f1d0a33e67b522e9ae36cc47c3f4ddb4ed3fd82f7399b2bfd1ed8",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[known_erc20]": "c6c7d787d8601e763bb6226e162250198a696c2134b32a81e4b9e7ded796ee79",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[large_chainid]": "4796b85a0e684de5ad699055bcb0009ba4b5750e3156b36f9936e48f0111f9df",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[erc20]": "86a2b03fe7f23e93d561e840e02ccbdf302ba6a8c521a8d700d1484b30f5929a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[large_chainid]": "01165868bb08fd60b5f9b83a96db0cf8698f45453e7b7f876c8a1c539ec2dea6",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[long_fees]": "7edbff2ecf112e55d91e54392615a27ef4f4d5b159e91a0071d4c3ea2047a852",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[nodata]": "62854c008d12948c388c267ca66c7e25bdc5e245988267e4a1237d643dba21f5",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559[unknown_erc20]": "86a2b03fe7f23e93d561e840e02ccbdf302ba6a8c521a8d700d1484b30f5929a",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559_access_list": "1168af18805383061d7ef53a7670756f5bc3261254750bd0ac49fc72f3701940",
|
||||
"TT_ethereum-test_signtx.py::test_signtx_eip1559_access_list_larger": "1168af18805383061d7ef53a7670756f5bc3261254750bd0ac49fc72f3701940",
|
||||
"TT_misc-test_cosi.py::test_cosi_different_key": "80a6e289138a604cf351a29511cf6f85e2243591317894703152787e1351a1a3",
|
||||
|
Loading…
Reference in New Issue
Block a user