1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 21:22:10 +00:00

fix(tests): Fix SignMessage tests after adding address dialog.

This commit is contained in:
Andrew Kozlik 2021-11-05 21:25:20 +01:00 committed by Andrew Kozlik
parent 9a7990d087
commit 39a0901e99
4 changed files with 59 additions and 62 deletions

View File

@ -84,6 +84,11 @@ def test_cancel_on_paginated(client):
)
resp = client.call_raw(message)
assert isinstance(resp, m.ButtonRequest)
client._raw_write(m.ButtonAck())
client.debug.press_yes()
resp = client._raw_read()
assert isinstance(resp, m.ButtonRequest)
assert resp.pages is not None
client._raw_write(m.ButtonAck())

View File

@ -290,6 +290,11 @@ def test_signmessage_pagination(client, message):
# Join lines that are separated by a single "-" string, space-separate lines otherwise.
nonlocal message_read
# confirm address
br = yield
layout = client.debug.wait_layout()
client.debug.press_yes()
# start assuming there was a word break; this avoids prepending space at start
word_break = True
br = yield
@ -332,6 +337,8 @@ def test_signmessage_pagination_trailing_newline(client):
with client:
client.set_expected_responses(
[
# expect address confirmation
message_filters.ButtonRequest(code=messages.ButtonRequestType.Other),
# expect a ButtonRequest that does not have pagination set
message_filters.ButtonRequest(pages=None),
messages.MessageSignature,

View File

@ -273,33 +273,15 @@ def test_recovery_device(client):
)
@pytest.mark.skip_t2
def test_sign_message_t1(client):
def test_sign_message(client):
_assert_protection(client)
with client:
client.use_pin_sequence([PIN4])
client.set_expected_responses(
[
_pin_request(client),
messages.PassphraseRequest,
messages.ButtonRequest,
_pin_request(client),
messages.PassphraseRequest,
messages.MessageSignature,
]
)
btc.sign_message(
client, "Bitcoin", parse_path("44h/0h/0h/0/0"), "testing message"
)
@pytest.mark.skip_t1
def test_sign_message_t2(client):
_assert_protection(client)
with client:
client.use_pin_sequence([PIN4])
client.set_expected_responses(
[
_pin_request(client),
messages.PassphraseRequest,
messages.ButtonRequest,
messages.MessageSignature,
]

View File

@ -209,14 +209,14 @@
"ethereum-test_sign_typed_data.py::test_ethereum_sign_typed_data[struct_list_v4]": "b7e3475d4906942bc0e8d62203ae91a13ea0d702c3a7a53b9777bea670c4a7f7",
"ethereum-test_sign_typed_data.py::test_ethereum_sign_typed_data_cancel": "08712efae2d007610289bbfb3a8fe6800547e884636c83c5bf0e25f33728789e",
"ethereum-test_sign_typed_data.py::test_ethereum_sign_typed_data_show_more_button": "1adbea797586685ce09aae58b0a2b89e1617e4eaad23a8c1ac6fc10b041e57a5",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters0-result0]": "9e2383084cfa23440e7ff9cf95029c73b851f5732de0cb4fb5e89a0ee024fbed",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters1-result1]": "bd669f3ddc72582d3af7aa2e9757e68008690b78533f40eafacf0d071734c108",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters2-result2]": "6ccc6102d1289bce13e28ec2207c96abe4aa1ac0810a13181a874070e7bcf8f3",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters3-result3]": "83a4f41c4ac8b6c1fd8ac930cfd510d233cbdcfb5bf950a92a77211105154202",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters4-result4]": "cf30fc10cf7b3843d923b6c57e632e54e996a87f36caa87411a983eb31206d5a",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters5-result5]": "67a3e0391c12c24e51d838bc100602e678503bad4972f1218f336fe7264de6f9",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters6-result6]": "d7092b022ee0d523e6fd9d81d64e5e8b438b1926248e3bc178d9834a3eb00bca",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters7-result7]": "5c4d93b80d19a92662655dc2e5e5196869ed431dd5ce5a94230885396c396fdd",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters0-result0]": "f1e6c101dd906123b07046f88989411a33946aa28d6c0cee1ff5d3a4aab0153f",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters1-result1]": "3e5245efed8b3a1fa68eaa6d4af94b34efd5e7a9e7b31a844e31e7f29c068391",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters2-result2]": "4d93e2556462e677729551ee0aa74ef23d9265eac03644140a84a162a890c9c0",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters3-result3]": "86720fcf876c34999ff4c39624a8cd14061a30c660dbaa37a992a3fbd6b6f0d0",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters4-result4]": "7ecf677cb4b266b20a096900d8521c1e2c848db6e316f79305a215a8549f9e9b",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters5-result5]": "a51bbb9a07cbd0e4cde50ecab1606a291a2cc2bf418704c643daf77bcc459c06",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters6-result6]": "a0f6ea77dade299d9d04c47c417154266ff8f4926c1181d960a4f8ab5067ba75",
"ethereum-test_sign_verify_message.py::test_signmessage[parameters7-result7]": "eb86c06357d5076cfbd8ebf7a963f00b88f7ae5a9ead75c5e4aa7a7b9c5e54ef",
"ethereum-test_sign_verify_message.py::test_verify[parameters0-result0]": "7e83f210ce98fee92e34bcc95d311701ec79702f8430239921efa72ff7759af6",
"ethereum-test_sign_verify_message.py::test_verify[parameters1-result1]": "6695a0f1762c5b2b591d3b11df5e94ccafd9b7690fcb7a4eb86eeb993e935900",
"ethereum-test_sign_verify_message.py::test_verify[parameters2-result2]": "13cdad44a69c985c7680f2e963edd151f382a0895fb7d5f2767da21d953c292d",
@ -282,7 +282,7 @@
"test_cancel.py::test_cancel_message_via_cancel[message1]": "b014449cbf1a45739d64a370b30af75df2228f48c090a02227bac8ed20c7b2dc",
"test_cancel.py::test_cancel_message_via_initialize[message0]": "b014449cbf1a45739d64a370b30af75df2228f48c090a02227bac8ed20c7b2dc",
"test_cancel.py::test_cancel_message_via_initialize[message1]": "b014449cbf1a45739d64a370b30af75df2228f48c090a02227bac8ed20c7b2dc",
"test_cancel.py::test_cancel_on_paginated": "b014449cbf1a45739d64a370b30af75df2228f48c090a02227bac8ed20c7b2dc",
"test_cancel.py::test_cancel_on_paginated": "6b8a80b8e81a14c0183805fac48a36f9cc61daa290d04d295032ab76ec83300f",
"test_debuglink.py::test_softlock_instability": "9750df55cb4716f1d497d57de57257a0c5188fb652fcdb66a9d436d9c396c62b",
"test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDADDRESS-pkh([5c9e228d--320142b4": "24290396b20f26b49204a5551676d6f3c831009e30582d92d5b44fcc3c12fdb7",
"test_descriptors.py::test_descriptors[Bitcoin-0-InputScriptType.SPENDP2SHWITNESS-sh(wpkh([5-b24e2107": "8977c539f5680a5196ad0a4c6e16c44ca1bbdb79235dbf97e33aad8d47fe5d0c",
@ -537,31 +537,34 @@
"test_msg_sd_protect.py::test_refresh": "19d6d1a7bfa9a6dcf7da2c320d01ba03152d08faa08a11ea2b3dc28ad57b1b91",
"test_msg_sd_protect.py::test_wipe": "9e4b9968e7967e93f19d669acadd53c128a857b72afd7e354a1a350274b8aeba",
"test_msg_signidentity.py-test_sign": "60cec9c50d0456731be185a29f8b06f7dfc8a2fff16db21e7b619a4078543f0f",
"test_msg_signmessage.py::test_signmessage[NFC message]": "fa2675d3a42768493a69a9d30bedec48eec3927c7cceef6b79a997bf5fec6057",
"test_msg_signmessage.py::test_signmessage[NFKD message]": "fa2675d3a42768493a69a9d30bedec48eec3927c7cceef6b79a997bf5fec6057",
"test_msg_signmessage.py::test_signmessage[bcash]": "78d23d6c96abf9992211e59283bd9232d014608974cf95630f7e51cf89e0cb93",
"test_msg_signmessage.py::test_signmessage[decred-empty]": "9c7cfd0146cf4b3215683c2a5d3548b4211485aad1dcbc52f2457f648ae569f6",
"test_msg_signmessage.py::test_signmessage[decred]": "bf26a48caf51c59fd377806ce7e26964a10980f4ad3fefbe252613e543ac4dc8",
"test_msg_signmessage.py::test_signmessage[grs-p2pkh]": "c97bf391b6625b818c5ece666fefa54536bbc063d63397f352b478197650be41",
"test_msg_signmessage.py::test_signmessage[grs-segwit-native]": "c97bf391b6625b818c5ece666fefa54536bbc063d63397f352b478197650be41",
"test_msg_signmessage.py::test_signmessage[grs-segwit-p2sh]": "c97bf391b6625b818c5ece666fefa54536bbc063d63397f352b478197650be41",
"test_msg_signmessage.py::test_signmessage[p2pkh long message]": "d289a26ee93d2a97370c6d93597463ee8625e90532338696ab3e858be2dea3c7",
"test_msg_signmessage.py::test_signmessage[p2pkh0]": "d16c46e129097121171e14acc28247058f502b8240380cc909e5ce3fdb948e44",
"test_msg_signmessage.py::test_signmessage[p2pkh1]": "542e21113b386389f1fd1cfc632eb2847e946cdf44d5ca759edf6082b5e1712b",
"test_msg_signmessage.py::test_signmessage[segwit-native long message]": "d289a26ee93d2a97370c6d93597463ee8625e90532338696ab3e858be2dea3c7",
"test_msg_signmessage.py::test_signmessage[segwit-native0]": "d16c46e129097121171e14acc28247058f502b8240380cc909e5ce3fdb948e44",
"test_msg_signmessage.py::test_signmessage[segwit-native1]": "542e21113b386389f1fd1cfc632eb2847e946cdf44d5ca759edf6082b5e1712b",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh long message]": "d289a26ee93d2a97370c6d93597463ee8625e90532338696ab3e858be2dea3c7",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh0]": "d16c46e129097121171e14acc28247058f502b8240380cc909e5ce3fdb948e44",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh1]": "542e21113b386389f1fd1cfc632eb2847e946cdf44d5ca759edf6082b5e1712b",
"test_msg_signmessage.py::test_signmessage_pagination[long_words]": "32b7822628c8652ae558a715390421cd2e29b707b58b60e012338eb9e3ff956b",
"test_msg_signmessage.py::test_signmessage_pagination[newlines]": "d54bdc38376cd70b658b189fcad3b0c58e88c23ebcba023420ff81b45329dea9",
"test_msg_signmessage.py::test_signmessage_pagination[no_spaces]": "af5eeda691036de08ffa76e0ce95901a76594736c6f7f90ad27362fd3acd0e70",
"test_msg_signmessage.py::test_signmessage_pagination[normal_text]": "78a1a9cd4efccc296ff606a9bad1b7490e290d3042643e1ac7d7025925cff368",
"test_msg_signmessage.py::test_signmessage_pagination[single_line_over]": "ecfaf919f71300f8c48e5bb548f14065aab65713323faba29a65c60539d0c115",
"test_msg_signmessage.py::test_signmessage_pagination[utf_nospace]": "2d9e03852e371de72d91b1fe8ed8349d81732ba636d509e9892450749f3a7a26",
"test_msg_signmessage.py::test_signmessage_pagination[utf_text]": "d417b11d5f2dd2118f67ef3c6798442ef082c0d44e468e4fc86554126da1053d",
"test_msg_signmessage.py::test_signmessage_pagination_trailing_newline": "f092598b69d0dbd79dc702f6fee19d3b3dfd8bc5b768d42940538addd50ee20f",
"test_msg_signmessage.py::test_signmessage[NFC message]": "ada02192053a4ab778bb9a71a20dffce12683191002b00c250a23431258d457a",
"test_msg_signmessage.py::test_signmessage[NFKD message]": "ada02192053a4ab778bb9a71a20dffce12683191002b00c250a23431258d457a",
"test_msg_signmessage.py::test_signmessage[bcash]": "3f1947b00ba9320aba41005811a9a4b1d93b65f7892bf5fca159c8c9428cad93",
"test_msg_signmessage.py::test_signmessage[decred-empty]": "fda0bc81d2b6db2bafa0dee4bf4dfbec77812b3982f1d56ea196b2d2cd3aaa0e",
"test_msg_signmessage.py::test_signmessage[decred]": "e4e09254391a5f708b179990688d9fd9a71777609a7fe7cc2058999bc52fbcb0",
"test_msg_signmessage.py::test_signmessage[grs-p2pkh]": "b7e9a8802649e96a13586506c585f6f33899615454bbe55c3a37af13fcbd448b",
"test_msg_signmessage.py::test_signmessage[grs-segwit-native]": "b79bbaad7786b0022cea1568108cb55488744b1d6b66cc622bc2d9711a04fbc1",
"test_msg_signmessage.py::test_signmessage[grs-segwit-p2sh]": "dec60209eca0a796c5051b8df421cf0727685c753a6161e3d35900cb84ca34ae",
"test_msg_signmessage.py::test_signmessage[p2pkh long message]": "52f5fc9c34945563a64dff58d9b78461657288a8632bc706672918ae41252ce1",
"test_msg_signmessage.py::test_signmessage[p2pkh0]": "9106fd70d8d577dc1802b7cbe42476d5dc27b2bc13d4a7c6e7977450ff721291",
"test_msg_signmessage.py::test_signmessage[p2pkh1]": "9106fd70d8d577dc1802b7cbe42476d5dc27b2bc13d4a7c6e7977450ff721291",
"test_msg_signmessage.py::test_signmessage[p2pkh2]": "9033a500500b12f396307d805f28f40b15b6fa5d3488275b5698ff9519b1cfda",
"test_msg_signmessage.py::test_signmessage[segwit-native long message]": "9774fc928d687b997ce308d6efbdce4033b178ddcc75857a9068c42e308f65e6",
"test_msg_signmessage.py::test_signmessage[segwit-native0]": "1ea020642e717986dae8a28292bdd559b0b8c6db1516a4c8721acdc3ad9a4054",
"test_msg_signmessage.py::test_signmessage[segwit-native1]": "1ea020642e717986dae8a28292bdd559b0b8c6db1516a4c8721acdc3ad9a4054",
"test_msg_signmessage.py::test_signmessage[segwit-native2]": "1c255b6a5d49a7d962d1c6d3bd008c6feecdfeb7a12c18bbf84bff4d1c84ec20",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh long message]": "483345387e80f95493b93a16df9361fcf7f7e4251fe178bbb5fbd43fa348beb1",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh0]": "95ffa70d0a38db3a2ae67975797a0b8ce46cb32ee2d66ae7b8466ac79e906dee",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh1]": "95ffa70d0a38db3a2ae67975797a0b8ce46cb32ee2d66ae7b8466ac79e906dee",
"test_msg_signmessage.py::test_signmessage[segwit-p2sh2]": "b3fdf06d5dc5553c4ac320656f32518c95a197718c99bbbdad51373598a4fe57",
"test_msg_signmessage.py::test_signmessage_pagination[long_words]": "8f694de7a448527f26bdbcc630148cc235871b03a91d5b0fb8fa105c3eb42655",
"test_msg_signmessage.py::test_signmessage_pagination[newlines]": "19b13aff4821db18c5ace2f7679882c93c26a67c3e36bd7a80d7132a6c2341ae",
"test_msg_signmessage.py::test_signmessage_pagination[no_spaces]": "43ba478ea5edcf1eee0c65db06c0378a32083a4143f7f104c10f66f5a2125413",
"test_msg_signmessage.py::test_signmessage_pagination[normal_text]": "d415a269b781527981a6457481c5f669ba17757c387597781979c2bfadd242d7",
"test_msg_signmessage.py::test_signmessage_pagination[single_line_over]": "59e7e7a534cdf011040327bd549450cddbaa2aa3ef3f51bf2e103f63db54a4ab",
"test_msg_signmessage.py::test_signmessage_pagination[utf_nospace]": "97d516b54b1ea715eeeee35eff5beadb5eaf6793032270dd3790c03693ed77fb",
"test_msg_signmessage.py::test_signmessage_pagination[utf_text]": "bc0be22538e591e5f2ed432c7ec5c4ece527ee8665b09f8822772dafcc0ba768",
"test_msg_signmessage.py::test_signmessage_pagination_trailing_newline": "d88d6ec3c7e1bbe32bf1bc4a826f2224bb2dcb030663fd6b562cf67c3ead23e5",
"test_msg_signtx.py-test_attack_change_input_address": "5f230e46301f0af85b5c40944cae1a8e4d3fc576fb19d7b7374decb463c8be62",
"test_msg_signtx.py-test_attack_change_outputs": "2e8e05aa366da0ce2990a2b8b76f13973af8eaa11ec0cb5591412a9a5ba48da4",
"test_msg_signtx.py-test_attack_modify_change_address": "72b96c639ac76ecccbe5d710a1c84eba6711879c329952b18ffab385ca79bafd",
@ -769,11 +772,11 @@
"test_nonstandard_paths.py::test_getpublicnode[m-3'-100'-4-255-script_types1]": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",
"test_nonstandard_paths.py::test_getpublicnode[m-4-255-script_types0]": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",
"test_nonstandard_paths.py::test_getpublicnode[m-49-0-63-0-255-script_types4]": "c09de07fbbf1e047442180e2facb5482d06a1a428891b875b7dd93c9e4704ae1",
"test_nonstandard_paths.py::test_signmessage[m-1195487518-6-255-script_types3]": "31eaf6185c2ea572503638387fe115f95b4cde2f2019e107783c82e463550dd3",
"test_nonstandard_paths.py::test_signmessage[m-1195487518-script_types2]": "31eaf6185c2ea572503638387fe115f95b4cde2f2019e107783c82e463550dd3",
"test_nonstandard_paths.py::test_signmessage[m-3'-100'-4-255-script_types1]": "31eaf6185c2ea572503638387fe115f95b4cde2f2019e107783c82e463550dd3",
"test_nonstandard_paths.py::test_signmessage[m-4-255-script_types0]": "31eaf6185c2ea572503638387fe115f95b4cde2f2019e107783c82e463550dd3",
"test_nonstandard_paths.py::test_signmessage[m-49-0-63-0-255-script_types4]": "d16c46e129097121171e14acc28247058f502b8240380cc909e5ce3fdb948e44",
"test_nonstandard_paths.py::test_signmessage[m-1195487518-6-255-script_types3]": "64b63aca6ff2fd15e10c64b3f89519c0f740c4bf5cae3aa525fabff346828448",
"test_nonstandard_paths.py::test_signmessage[m-1195487518-script_types2]": "3428f8015ebe9dfb9e29323bec319bf45e33c954e60390b9cdd68b9633a5d7aa",
"test_nonstandard_paths.py::test_signmessage[m-3'-100'-4-255-script_types1]": "d00b3b6b19969b407f4e6659899f8f31f25d59efc0126f824ac73513b9bb4dbd",
"test_nonstandard_paths.py::test_signmessage[m-4-255-script_types0]": "89b2bc6dd1a6f854b5f58a111b9079478db0aed46ddbad122779d9f9ff22030f",
"test_nonstandard_paths.py::test_signmessage[m-49-0-63-0-255-script_types4]": "b7106ad62f090657166c8d2656c748ae74c6b05b4599ddc5b0ea3d3fd80701ba",
"test_nonstandard_paths.py::test_signtx[m-1195487518-6-255-script_types3]": "37cfe119620536464ae42b3fbcae7b89d9272ad904da2bd8e8ae47b1024b4007",
"test_nonstandard_paths.py::test_signtx[m-1195487518-script_types2]": "27a03a5be542d1f5f76a839e65daec766c1d7de8ae4637404ffcfea8267ea0ec",
"test_nonstandard_paths.py::test_signtx[m-3'-100'-4-255-script_types1]": "efbe785820901471b0e55f9fd743c84a29fe719c2e1c8e6b2f87b0a20ce43cb2",
@ -807,7 +810,7 @@
"test_protection_levels.py::test_passphrase_reporting[False]": "233f8978b159ec8fb4092599d63f001c8059222ca14a9e84d185560d3c32ce24",
"test_protection_levels.py::test_passphrase_reporting[True]": "d9e9bdb39d15d6737ed6234f16c36bb7ad95ca54067ff8f10cffccaa3caa96cb",
"test_protection_levels.py::test_ping": "5551c263e8e09c8ae683f4dec3dd9d7ecc05ebbd3f2556604b27479c8f1fbc82",
"test_protection_levels.py::test_sign_message_t2": "bdcc7268caf112c3ba1708d9387fcca8384b330ba5a1e500df87e5fa3b0a4320",
"test_protection_levels.py::test_sign_message": "ffebfda06e622cda3b4504f3e15b451d8a4ea9d0a568a2035893466811986dc6",
"test_protection_levels.py::test_signtx": "f13f1687e062bd407dc781ae93ebb6619eee5ea3d37ee031ffdc98d5bd7aea33",
"test_protection_levels.py::test_unlocked": "f2be4c8c13c6a201770966438ffa9bcfe0eb031683920f93a55fa92921a28b51",
"test_protection_levels.py::test_verify_message_t2": "c258650c3697a46c61b67306b89cec1d67900095aeed05d4a691600a2cc12c2f",
@ -860,8 +863,8 @@
"test_stellar.py::test_sign_tx[StellarChangeTrustOp-delete]": "ec26e6883ba9405412674431e0ec07504b3f25682ce7d76ebd445b809194198a",
"test_stellar.py::test_sign_tx[StellarCreateAccountOp]": "2582717c25974d2b3ee156624b00375148ff7fd12eeea73625a7c367fa610373",
"test_stellar.py::test_sign_tx[StellarCreatePassiveSellOfferOp]": "6b0f0d2b746f98e2c85006ea7e2d5c49cd9277662e47f223138ff418066791e3",
"test_stellar.py::test_sign_tx[StellarManageDataOp]": "8fbec6547a8f9d1f002181db0cbe57fe86abef8d365b1c06fd14292cd0b068a7",
"test_stellar.py::test_sign_tx[StellarManageBuyOfferOp]": "fc57e1ca8b65588aa16cc3524d6dc0f01e094ad5d16a6f7e739a69c101b554bc",
"test_stellar.py::test_sign_tx[StellarManageDataOp]": "8fbec6547a8f9d1f002181db0cbe57fe86abef8d365b1c06fd14292cd0b068a7",
"test_stellar.py::test_sign_tx[StellarManageSellOfferOp]": "6ed84765b2ed46711be0ed1219d91c27e927119d352f37b2baf8c6501186bbce",
"test_stellar.py::test_sign_tx[StellarPathPaymentStrictReceiveOp]": "58f3bfaece0706bc172d6e6564b728ec0b7f8e2629d8c64dc60672786586076d",
"test_stellar.py::test_sign_tx[StellarPathPaymentStrictSendOp]": "fdd36a59520317d514e03f535dfeb93339af0f7ea5ee07c556bee3c8784c94ed",