From bd0b91a229473c23c224f7dd0e3ee50e53480059 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 20 Nov 2020 17:49:46 +0100 Subject: [PATCH] fix(tests): fix extra ETH unknown token dialog for T1 --- .../device_tests/test_msg_ethereum_signtx.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/device_tests/test_msg_ethereum_signtx.py b/tests/device_tests/test_msg_ethereum_signtx.py index 41ea06af0e..62acffb2d7 100644 --- a/tests/device_tests/test_msg_ethereum_signtx.py +++ b/tests/device_tests/test_msg_ethereum_signtx.py @@ -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