1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

fix(tests): fix extra ETH unknown token dialog for T1

This commit is contained in:
Tomas Susanka 2020-11-20 17:49:46 +01:00
parent fe55f0c1f0
commit bd0b91a229

View File

@ -117,14 +117,18 @@ class TestMsgEthereumSigntx:
@pytest.mark.setup_client(mnemonic=MNEMONIC12)
def test_ethereum_signtx_unknown_erc20_token(self, client):
with client:
client.set_expected_responses(
[
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
messages.EthereumTxRequest(data_length=None),
]
)
expected_responses = [
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx),
]
# TT asks for contract address confirmation
if client.features.model == "T":
expected_responses.append(
messages.ButtonRequest(code=messages.ButtonRequestType.SignTx)
)
expected_responses.append(messages.EthereumTxRequest(data_length=None))
client.set_expected_responses(expected_responses)
data = bytearray()
# method id signalizing `transfer(address _to, uint256 _value)` function