What changed, and why it matters
This commit only rewrites test code to use named pytest parameters (adding readable IDs to test cases). It does not change any production firmware, wallet logic, or security behavior. There is no security issue here.
No action required. This is a benign test-maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a large test-only refactoring across 18 files in the tests/ directory. It converts anonymous tuples in pytest.mark.parametrize tables into pytest.param(…, id=…) calls, adds named fixture IDs, and extracts a couple of repeated secret constants. No firmware source code, cryptographic code, protocol handlers, or device behavior were modified. The fixtures.json file is listed as changed but no diff is provided; given the test-only nature of the other changes it is almost certainly a regenerated UI test fixture cache.
Changed components
tests/click_tests/test_passphrase_bde.pytests/click_tests/test_passphrase_caesar.pytests/device_tests/bitcoin/test_descriptors.pytests/device_tests/bitcoin/test_getaddress_segwit_native.pytests/device_tests/bitcoin/test_getaddress_show.pytests/device_tests/bitcoin/test_getpublickey.pytests/device_tests/bitcoin/test_getpublickey_curve.pytests/device_tests/bitcoin/test_nonstandard_paths.pytests/device_tests/bitcoin/test_signtx_prevhash.pytests/device_tests/bitcoin/test_signtx_replacement.pytests/device_tests/bitcoin/test_signtx_taproot.pytests/device_tests/misc/test_msg_getentropy.pytests/device_tests/monero/test_getaddress.pytests/device_tests/nostr/test_nostr.pytests/device_tests/reset_recovery/test_recovery_slip39_advanced.pytests/device_tests/test_msg_change_wipe_code_t1.pytests/device_tests/test_msg_changepin_t1.pytests/ui_tests/fixtures.jsonInspect captured patch +7050 / −6907
### tests/click_tests/test_passphrase_bde.py
@@ -101,11 +101,13 @@ def enter_passphrase(debug: "DebugLink") -> None:
VECTORS = ( # passphrase, address
- (CommonPass.SHORT, CommonPass.SHORT_ADDRESS),
- (CommonPass.WITH_SPACE, CommonPass.WITH_SPACE_ADDRESS),
- (CommonPass.RANDOM_25, CommonPass.RANDOM_25_ADDRESS),
- (CommonPass.WWW_SHORTER, CommonPass.WWW_SHORTER_ADDRESS),
- (CommonPass.WWW_LIMIT, CommonPass.WWW_LIMIT_ADDRESS),
+ pytest.param(CommonPass.SHORT, CommonPass.SHORT_ADDRESS, id="short"),
+ pytest.param(CommonPass.WITH_SPACE, CommonPass.WITH_SPACE_ADDRESS, id="with_space"),
+ pytest.param(CommonPass.RANDOM_25, CommonPass.RANDOM_25_ADDRESS, id="random_25"),
+ pytest.param(
+ CommonPass.WWW_SHORTER, CommonPass.WWW_SHORTER_ADDRESS, id="www_shorter"
+ ),
+ pytest.param(CommonPass.WWW_LIMIT, CommonPass.WWW_LIMIT_ADDRESS, id="www_limit"),
)
### tests/click_tests/test_passphrase_caesar.py
@@ -190,11 +190,13 @@ def cancel(debug: "DebugLink") -> None:
VECTORS = ( # passphrase, address
- (CommonPass.SHORT, CommonPass.SHORT_ADDRESS),
- (CommonPass.WITH_SPACE, CommonPass.WITH_SPACE_ADDRESS),
- (CommonPass.RANDOM_25, CommonPass.RANDOM_25_ADDRESS),
- (CommonPass.WWW_SHORTER, CommonPass.WWW_SHORTER_ADDRESS),
- (CommonPass.WWW_LIMIT, CommonPass.WWW_LIMIT_ADDRESS),
+ pytest.param(CommonPass.SHORT, CommonPass.SHORT_ADDRESS, id="short"),
+ pytest.param(CommonPass.WITH_SPACE, CommonPass.WITH_SPACE_ADDRESS, id="with_space"),
+ pytest.param(CommonPass.RANDOM_25, CommonPass.RANDOM_25_ADDRESS, id="random_25"),
+ pytest.param(
+ CommonPass.WWW_SHORTER, CommonPass.WWW_SHORTER_ADDRESS, id="www_shorter"
+ ),
+ pytest.param(CommonPass.WWW_LIMIT, CommonPass.WWW_LIMIT_ADDRESS, id="www_limit"),
)
### tests/device_tests/bitcoin/test_descriptors.py
@@ -24,131 +24,149 @@
from ...input_flows import InputFlowShowXpubQRCode
VECTORS_DESCRIPTORS = ( # coin, account, script_type, descriptors
- (
+ pytest.param(
"Bitcoin",
0,
44,
messages.InputScriptType.SPENDADDRESS,
"pkh([5c9e228d/44h/0h/0h]xpub6BiVtCpG9fQPxnPmHXG8PhtzQdWC2Su4qWu6XW9tpWFYhxydCLJGrWBJZ5H6qTAHdPQ7pQhtpjiYZVZARo14qHiay2fvrX996oEP42u8wZy/<0;1>/*)#m2cjewq5",
+ id="Bitcoin-44h-account0",
),
- (
+ pytest.param(
"Bitcoin",
1,
44,
messages.InputScriptType.SPENDADDRESS,
"pkh([5c9e228d/44h/0h/1h]xpub6BiVtCpG9fQQ1EW99bMSYwySbPWvzTFRQZCFgTmV3samLSZAYU7C3f4Je9vkNh7h1GAWi5Fn93BwoGBy9EAXbWTTgTnVKAbthHpxM1fXVRL/<0;1>/*)#rajluyqc",
+ id="Bitcoin-44h-account1",
),
- (
+ pytest.param(
"Testnet",
0,
44,
messages.InputScriptType.SPENDADDRESS,
"pkh([5c9e228d/44h/1h/0h]tpubDDKn3FtHc74CaRrRbi1WFdJNaaenZkDWqq9NsEhcafnDZ4VuKeuLG2aKHm5SuwuLgAhRkkfHqcCxpnVNSrs5kJYZXwa6Ud431VnevzzzK3U/<0;1>/*)#zye2wu3m",
+ id="Testnet-44h-account0",
),
- (
+ pytest.param(
"Testnet",
1,
44,
messages.InputScriptType.SPENDADDRESS,
"pkh([5c9e228d/44h/1h/1h]tpubDDKn3FtHc74CcBfxJ3zdSNnRacuggmGwv3KEZLJP2LAuqc3HhsQR5ZAVudcQzezzXs7T6QrDtoJJYvgyDUJ9vgWx3Y7Et4Ats1Q25U1LXvU/<0;1>/*)#98ps5dsf",
+ id="Testnet-44h-account1",
),
- (
+ pytest.param(
"Bitcoin",
0,
49,
messages.InputScriptType.SPENDP2SHWITNESS,
"sh(wpkh([5c9e228d/49h/0h/0h]xpub6CVKsQYXc9awxgV1tWbG4foDvdcnieK2JkbpPEBKB5WwAPKBZ1mstLbKVB4ov7QzxzjaxNK6EfmNY5Jsk2cG26EVcEkycGW4tchT2dyUhrx/<0;1>/*))#38fl96mv",
+ id="Bitcoin-49h-account0",
),
- (
+ pytest.param(
"Bitcoin",
1,
49,
messages.InputScriptType.SPENDP2SHWITNESS,
"sh(wpkh([5c9e228d/49h/0h/1h]xpub6CVKsQYXc9ax22ig3KAZMRiJL1xT9Me1sFX3t34mnVVzr6FkciU74qk7AqBkePQ2sM9pKeWp88KfPT2qcVQ19ykqGHMDioJhwywGuJ96Xt8/<0;1>/*))#sl78qw4y",
+ id="Bitcoin-49h-account1",
),
- (
+ pytest.param(
"Testnet",
0,
49,
messages.InputScriptType.SPENDP2SHWITNESS,
"sh(wpkh([5c9e228d/49h/1h/0h]tpubDCHRnuvE95JrpEVTUmr36sK3K9ADf3s3aztpXzL8coBeCTE8cHV8PjxS6SjWJM3GfPn798gyEa3dRPgjoUDSuNfuC9xz4PHznwKEk2XL7X1/<0;1>/*))#462xu5sy",
+ id="Testnet-49h-account0",
),
- (
+ pytest.param(
"Testnet",
1,
49,
messages.InputScriptType.SPENDP2SHWITNESS,
"sh(wpkh([5c9e228d/49h/1h/1h]tpubDCHRnuvE95Jrs9NkLaZwKNdoHBSoCRge6wKunXyxnspvLpx3aZbJcScTnTdsEqT6uFfWdMvBmLs3jhnkBiE7ob3xVQPV8ngDPYAMs93X9xv/<0;1>/*))#zlqkrt84",
+ id="Testnet-49h-account1",
),
- (
+ pytest.param(
"Bitcoin",
0,
84,
messages.InputScriptType.SPENDWITNESS,
"wpkh([5c9e228d/84h/0h/0h]xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF/<0;1>/*)#u9auedf8",
+ id="Bitcoin-84h-account0",
),
- (
+ pytest.param(
"Bitcoin",
1,
84,
messages.InputScriptType.SPENDWITNESS,
"wpkh([5c9e228d/84h/0h/1h]xpub6DDUPHpUo4pd1hyVtRaknvZvCgdPdEDMKx3bB5UFcx73pEHRDVK4rwEZUgeUbVuYWGMNLvuBHp5WeyPevN2Gv7m9FnLHQE6XaKNRPZcYcHH/<0;1>/*)#fdfl9z8m",
+ id="Bitcoin-84h-account1",
),
- (
+ pytest.param(
"Testnet",
0,
84,
messages.InputScriptType.SPENDWITNESS,
"wpkh([5c9e228d/84h/1h/0h]tpubDCZB6sR48s4T5Cr8qHUYSZEFCQMMHRg8AoVKVmvcAP5bRw7ArDKeoNwKAJujV3xCPkBvXH5ejSgbgyN6kREmF7sMd41NdbuHa8n1DZNxSMg/<0;1>/*)#wqdf6rm4",
+ id="Testnet-84h-account0",
),
- (
+ pytest.param(
"Testnet",
1,
84,
messages.InputScriptType.SPENDWITNESS,
"wpkh([5c9e228d/84h/1h/1h]tpubDCZB6sR48s4T6xoXqaYxScvf23kmQvg5QpyFkYnDBjsmviKHLSG9s6cp593Exg87tuMjXXMWDvBRXnJtzppcQf8Z8HdJP1rothfxm4qnPXo/<0;1>/*)#874stzg5",
+ id="Testnet-84h-account1",
),
- (
+ pytest.param(
"Bitcoin",
0,
86,
messages.InputScriptType.SPENDTAPROOT,
"tr([5c9e228d/86h/0h/0h]xpub6Bw885JisRbcKmowfBvMmCxaFHodKn1VpmRmctmJJoM8D4DzyP4qJv8ZdD9V9r3SSGjmK2KJEDnvLH6f1Q4HrobEvnCeKydNvf1eir3RHZk/<0;1>/*)#9thz2a5h",
+ id="Bitcoin-86h-account0",
),
- (
+ pytest.param(
"Bitcoin",
1,
86,
messages.InputScriptType.SPENDTAPROOT,
"tr([5c9e228d/86h/0h/1h]xpub6Bw885JisRbcLp1379q64fdNPGTnHKYGcA9wcWqGcUgkKZkYCwXSCb9Qfw8DGDgYMmcDM8QwQGooqCM3Ym4yq8kS5dBjzZSXUdVUdhyfirD/<0;1>/*)#s6l0qp0p",
+ id="Bitcoin-86h-account1",
),
- (
+ pytest.param(
"Testnet",
0,
86,
messages.InputScriptType.SPENDTAPROOT,
"tr([5c9e228d/86h/1h/0h]tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/<0;1>/*)#nyxxzyuj",
+ id="Testnet-86h-account0",
),
- (
+ pytest.param(
"Testnet",
1,
86,
messages.InputScriptType.SPENDTAPROOT,
"tr([5c9e228d/86h/1h/1h]tpubDC88gkaZi5HvKcrFLNkZwcXx1YyShkmPTkSNoP5MHQnSP9vTrKEYKtoeEkX4oEJmNYSm6Y3fFcNV4xbkDE1uZZBmJe1ircegxgVnBW8j4SL/<0;1>/*)#e46q5twy",
+ id="Testnet-86h-account1",
),
- (
+ pytest.param(
"Bitcoin",
0,
10025,
messages.InputScriptType.SPENDTAPROOT,
"tr([5c9e228d/10025h/0h/0h/1h]xpub6F9fdWTs2pmUS7phuTZbAM6XttUQoEgue5gvZToVLFcxA3jitxsbK1ZrHrGnPRJkjv9XrHW7Lqi3DnjLuv4XWXaxFdVnh6MyX4hXrkuzQgf/<0;1>/*)#lfjly5y8",
+ id="Bitcoin-10025h-account0",
),
- (
+ pytest.param(
"Testnet",
0,
10025,
messages.InputScriptType.SPENDTAPROOT,
"tr([5c9e228d/10025h/1h/0h/1h]tpubDEMKm4M3S2Grx5DHTfbX9et5HQb9KhdjDCkUYdH9gvVofvPTE6yb2MH52P9uc4mx6eFohUmfN1f4hhHNK28GaZnWRXr3b8KkfFcySo1SmXU/<0;1>/*)#4frqe6n3",
+ id="Testnet-10025h-account0",
),
)
### tests/device_tests/bitcoin/test_getaddress_segwit_native.py
@@ -22,118 +22,136 @@
from trezorlib.tools import parse_path
VECTORS = ( # coin, path, script_type, address
- (
+ pytest.param(
"Testnet",
"m/84h/1h/0h/0/0",
messages.InputScriptType.SPENDWITNESS,
"tb1qkvwu9g3k2pdxewfqr7syz89r3gj557l3uuf9r9",
+ id="Testnet-m/84h/1h/0h/0/0",
),
- (
+ pytest.param(
"Testnet",
"m/84h/1h/0h/1/0",
messages.InputScriptType.SPENDWITNESS,
"tb1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt96jk9x",
+ id="Testnet-m/84h/1h/0h/1/0",
),
- (
+ pytest.param(
"Bitcoin",
"m/84h/0h/0h/0/0",
messages.InputScriptType.SPENDWITNESS,
"bc1qannfxke2tfd4l7vhepehpvt05y83v3qsf6nfkk",
+ id="Bitcoin-m/84h/0h/0h/0/0",
),
- (
+ pytest.param(
"Bitcoin",
"m/84h/0h/0h/1/0",
messages.InputScriptType.SPENDWITNESS,
"bc1qktmhrsmsenepnnfst8x6j27l0uqv7ggrg8x38q",
+ id="Bitcoin-m/84h/0h/0h/1/0",
),
- (
+ pytest.param(
"Testnet",
"m/86h/1h/0h/0/0",
messages.InputScriptType.SPENDTAPROOT,
"tb1pswrqtykue8r89t9u4rprjs0gt4qzkdfuursfnvqaa3f2yql07zmq8s8a5u",
+ id="Testnet-m/86h/1h/0h/0/0",
),
- (
+ pytest.param(
"Testnet",
"m/86h/1h/0h/1/0",
messages.InputScriptType.SPENDTAPROOT,
"tb1pn2d0yjeedavnkd8z8lhm566p0f2utm3lgvxrsdehnl94y34txmts5s7t4c",
+ id="Testnet-m/86h/1h/0h/1/0",
),
- (
+ pytest.param(
"Bitcoin",
"m/86h/0h/0h/0/0",
messages.InputScriptType.SPENDTAPROOT,
"bc1ptxs597p3fnpd8gwut5p467ulsydae3rp9z75hd99w8k3ljr9g9rqx6ynaw",
+ id="Bitcoin-m/86h/0h/0h/0/0",
),
- (
+ pytest.param(
"Bitcoin",
"m/86h/0h/0h/1/0",
messages.InputScriptType.SPENDTAPROOT,
"bc1pgypgja2hmcx2l6s2ssq75k6ev68ved6nujcspt47dgvkp8euc70s6uegk6",
+ id="Bitcoin-m/86h/0h/0h/1/0",
),
pytest.param(
"Groestlcoin Testnet",
"m/84h/1h/0h/0/0",
messages.InputScriptType.SPENDWITNESS,
"tgrs1qkvwu9g3k2pdxewfqr7syz89r3gj557l3ued7ja",
marks=pytest.mark.altcoin,
+ id="Groestlcoin_Testnet-m/84h/1h/0h/0/0",
),
pytest.param(
"Groestlcoin Testnet",
"m/84h/1h/0h/1/0",
messages.InputScriptType.SPENDWITNESS,
"tgrs1qejqxwzfld7zr6mf7ygqy5s5se5xq7vmt9lkd57",
marks=pytest.mark.altcoin,
+ id="Groestlcoin_Testnet-m/84h/1h/0h/1/0",
),
pytest.param(
"Groestlcoin",
"m/84h/17h/0h/0/0",
messages.InputScriptType.SPENDWITNESS,
"grs1qw4teyraux2s77nhjdwh9ar8rl9dt7zww8r6lne",
marks=pytest.mark.altcoin,
+ id="Groestlcoin-m/84h/17h/0h/0/0",
),
pytest.param(
"Groestlcoin",
"m/84h/17h/0h/1/0",
messages.InputScriptType.SPENDWITNESS,
"grs1qzfpwn55tvkxcw0xwfa0g8k2gtlzlgkcq3z000e",
marks=pytest.mark.altcoin,
+ id="Groestlcoin-m/84h/17h/0h/1/0",
),
pytest.param(
"Groestlcoin Testnet",
"m/86h/1h/0h/0/0",
messages.InputScriptType.SPENDTAPROOT,
"tgrs1pswrqtykue8r89t9u4rprjs0gt4qzkdfuursfnvqaa3f2yql07zmq5v2q7z",
marks=pytest.mark.altcoin,
+ id="Groestlcoin_Testnet-m/86h/1h/0h/0/0",
),
pytest.param(
"Groestlcoin",
"m/86h/17h/0h/0/0",
messages.InputScriptType.SPENDTAPROOT,
"grs1pnacleslusvh6gdjd3j2y5kv3drq09038sww2zx4za68jssndmu6qkm698g",
marks=pytest.mark.altcoin,
+ id="Groestlcoin-m/86h/17h/0h/0/0",
),
pytest.param(
"Elements",
"m/84h/1h/0h/0/0",
messages.InputScriptType.SPENDWITNESS,
"ert1qkvwu9g3k2pdxewfqr7syz89r3gj557l3xp9k2v",
marks=pytest.mark.altcoin,
+ id="Elements-m/84h/1h/0h/0/0",
),
)
BIP86_VECTORS = ( # path, address for "abandon ... abandon about" seed
- (
+ pytest.param(
"m/86h/0h/0h/0/0",
"bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr",
+ id="m/86h/0h/0h/0/0",
),
- (
+ pytest.param(
"m/86h/0h/0h/0/1",
"bc1p4qhjn9zdvkux4e44uhx8tc55attvtyu358kutcqkudyccelu0was9fqzwh",
+ id="m/86h/0h/0h/0/1",
),
- (
+ pytest.param(
"m/86h/0h/0h/1/0",
"bc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqwruhk7",
+ id="m/86h/0h/0h/1/0",
),
)
### tests/device_tests/bitcoin/test_getaddress_show.py
@@ -29,25 +29,29 @@
)
VECTORS = ( # path, script_type, address
- (
+ pytest.param(
"m/44h/0h/12h/0/0",
messages.InputScriptType.SPENDADDRESS,
"1FM6Kz3oT3GoGv65jNpU8AFFun8nHAXrPk",
+ id="m/44h/0h/12h/0/0",
),
- (
+ pytest.param(
"m/49h/0h/12h/0/0",
messages.InputScriptType.SPENDP2SHWITNESS,
"3HfEUkuwmtZ87XzowkiD5nMp5Q3hqKXZ2i",
+ id="m/49h/0h/12h/0/0",
),
- (
+ pytest.param(
"m/84h/0h/12h/0/0",
messages.InputScriptType.SPENDWITNESS,
"bc1qduvap743hcl7twn8u6f9l0u8y7x83965xy0raj",
+ id="m/84h/0h/12h/0/0",
),
- (
+ pytest.param(
"m/86h/0h/12h/0/0",
messages.InputScriptType.SPENDTAPROOT,
"bc1pnzsh9t0n0vjanwgkuf9cyrp6j6lhfe63xaekuu7qxkse93vkyvgqxn4hff",
+ id="m/86h/0h/12h/0/0",
),
)
@@ -175,7 +179,7 @@ def test_show_multisig_3(session: Session):
VECTORS_MULTISIG = ( # script_type, bip48_type, address, xpubs, ignore_xpub_magic
- (
+ pytest.param(
messages.InputScriptType.SPENDMULTISIG,
0,
"33TU5DyVi2kFSGQUfmZxNHgPDPqruwdesY",
@@ -185,8 +189,9 @@ def test_show_multisig_3(session: Session):
"xpub6F6Tq7sVLDrhuV3SpvsVKrKofF6Hx7oKxWLFkN6dbepuMhuYueKUnQo7E972GJyeRHqPKu44V1C9zBL6KW47GXjuprhbNrPQahWAFKoL2rN",
],
False,
+ id="SPENDMULTISIG-bip48_0h-native_xpub_magic",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDMULTISIG,
0,
"33TU5DyVi2kFSGQUfmZxNHgPDPqruwdesY",
@@ -196,8 +201,9 @@ def test_show_multisig_3(session: Session):
"xpub6F6Tq7sVLDrhuV3SpvsVKrKofF6Hx7oKxWLFkN6dbepuMhuYueKUnQo7E972GJyeRHqPKu44V1C9zBL6KW47GXjuprhbNrPQahWAFKoL2rN",
],
True,
+ id="SPENDMULTISIG-bip48_0h-ignore_xpub_magic",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDP2SHWITNESS,
1,
"3PwoNRb1v7HxofcH6xfiq52nFrDarsn1ap",
@@ -207,8 +213,9 @@ def test_show_multisig_3(session: Session):
"Ypub6kppG2Gr3rxZChPFhkMdPdLChewkPwLybPirJGBcJW1mRXeWdWvXLRP7xUcjJgTiGEQcJPKu8PTQMTtLXeiEjP7N2KGpamQnGUvBikJZvvP",
],
False,
+ id="SPENDP2SHWITNESS-bip48_1h-native_xpub_magic",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDP2SHWITNESS,
1,
"3PwoNRb1v7HxofcH6xfiq52nFrDarsn1ap",
@@ -218,8 +225,9 @@ def test_show_multisig_3(session: Session):
"xpub6F6Tq7sVLDrhvq2kvj72MTttotm3ExftN1Yxbc2BYioUkFGNcTNgdEs48ZhfkLatd8DpgKjDnWiMM1f1Wj9GnfK6KWTzbT8J72afkGf7Y9T",
],
True,
+ id="SPENDP2SHWITNESS-bip48_1h-ignore_xpub_magic",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDWITNESS,
2,
"bc1qqn9s63wly66rhzyz36hwzsa83augj5lve3ucqk5cpt5yvvze5ctsdfcg88",
@@ -229,8 +237,9 @@ def test_show_multisig_3(session: Session):
"Zpub75f5ZgwmCYW37REirFNaE8DBg9qKJznqD498DsTAbX89Lk6tA98huCGM29mHAhwYTo1PSbWLQHXvsmMhDB8W9dFt3Eb2o6hT7HLDrcPebM5",
],
False,
+ id="SPENDWITNESS-bip48_2h-native_xpub_magic",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDWITNESS,
2,
"bc1qqn9s63wly66rhzyz36hwzsa83augj5lve3ucqk5cpt5yvvze5ctsdfcg88",
@@ -240,6 +249,7 @@ def test_show_multisig_3(session: Session):
"xpub6F6Tq7sVLDrhzFh7EsLLysgNcRWADQ8F4ZT1jpPrTjXycMuWtRRJZx69B2tdcTQoR3ho54K6bkSKz2WoUZ9XQfn1U65nDsbUg6w4VZ5HWdA",
],
True,
+ id="SPENDWITNESS-bip48_2h-ignore_xpub_magic",
),
)
### tests/device_tests/bitcoin/test_getpublickey.py
@@ -25,87 +25,112 @@
from ...input_flows import InputFlowShowXpubQRCode
VECTORS_BITCOIN = ( # coin_name, xpub_magic, path, xpub
- (
+ pytest.param(
"Bitcoin",
0x0488B21E,
parse_path("m/44h/0h/0h"),
"xpub6BiVtCpG9fQPxnPmHXG8PhtzQdWC2Su4qWu6XW9tpWFYhxydCLJGrWBJZ5H6qTAHdPQ7pQhtpjiYZVZARo14qHiay2fvrX996oEP42u8wZy",
+ id="Bitcoin-m/44h/0h/0h",
),
- (
+ pytest.param(
"Bitcoin",
0x0488B21E,
parse_path("m/44h/0h/10h"),
"xpub6BiVtCpG9fQQR6cSuFeDaSvCDgNvNme499JUGX4RHDiZVWwZy9NwNieWKXHLe8XRbdrEmY87aqztBCbRJkXWV7VJB96XBT5cpkqYMHwvLWB",
+ id="Bitcoin-m/44h/0h/10h",
),
- (
+ pytest.param(
"Bitcoin",
0x0488B21E,
parse_path("m/44h/0h/0h/0/0"),
"xpub6FVDRC1jiWNTuT3embehwSZ1buxRDyZGbTakVCkBr6w2LwpERmYqXyvtrLeJX9hqzLaucS3qJXGekeFsSVCELkbgepp7FVGeH5BYekEgT9x",
+ id="Bitcoin-m/44h/0h/0h/0/0",
),
- (
+ pytest.param(
"Bitcoin",
0x0488B21E,
parse_path("m/44h/0h/10h/1/100"),
"xpub6GhTNegKCjTqjYS4HNkPhXHXHNZV2cPC38N7HbpUKexXXuTkjKPnijqKTB7yXidP4JtTUWTuWPTt6P55xi91NPgUp51BnqYzYdNhho4y5j8",
+ id="Bitcoin-m/44h/0h/10h/1/100",
),
- (
+ pytest.param(
"Testnet",
0x043587CF,
parse_path("m/44h/1h/0h"),
"tpubDDKn3FtHc74CaRrRbi1WFdJNaaenZkDWqq9NsEhcafnDZ4VuKeuLG2aKHm5SuwuLgAhRkkfHqcCxpnVNSrs5kJYZXwa6Ud431VnevzzzK3U",
+ id="Testnet-m/44h/1h/0h",
),
- (
+ pytest.param(
"Testnet",
0x043587CF,
parse_path("m/44h/1h/0h/0/0"),
"tpubDGwNSs8z8jZU2EcUiubR4frGvKqddvLBqCDNknnWhmoUd6EHrRWrqXmDaWBNddWzM5Yqh4e4TUYFK9hGCEnSrMKgV6cthRhArfZpwzihdw7",
+ id="Testnet-m/44h/1h/0h/0/0",
),
- ( # PSBT master fingerprint retrieval
+ pytest.param( # PSBT master fingerprint retrieval
"Bitcoin",
0x0488B21E,
parse_path("m/0h"),
"xpub68Zyu13qjcQvJXTsnmhH2h2TyPiXAama5bTU8u9iRXyYtS9X9yWvSKij6YGt7JJ2nr5rSGi4KLUW5Z8bTKHqXhbLwqb7smG3Y8j2wy4rmf3",
+ id="Bitcoin-m/0h",
),
pytest.param(
"Litecoin",
0x019DA462,
parse_path("m/44h/2h/0h"),
"Ltub2Y8PyEMWQVgiX4L4gVzU8PakBTQ2WBxFdS6tJARQeasUUfXmBut2jGShnQyD3jgyBf7mmvs5jPNgmgXad5J6M8a8FiZK78dbT21fYtTAC9a",
marks=pytest.mark.altcoin,
+ id="Litecoin-m/44h/2h/0h",
),
pytest.param(
"Litecoin",
0x019DA462,
parse_path("m/44h/2h/10h"),
"Ltub2Y8PyEMWQVgiy8Zio1XrKWkGL6ZmCZB9W5ShbvbzZ14irCrAb62YEoMafTAM5a2A6x6XNcyDdCNW7NVgES9jtQqyUZcBUFTimS7VVJ8tbpE",
marks=pytest.mark.altcoin,
+ id="Litecoin-m/44h/2h/10h",
),
pytest.param(
"Litecoin",
0x019DA462,
parse_path("m/44h/2h/0h/0/0"),
"Ltub2dTvwC4v7GNeR6UEaywQ6j72wHi4dwRo3oDDzvXAwb4CrXVQEUTbxC4hEfULiKByiUMEmYLhuMo1YMYmBBjKJ8kyk9ia5gZaVNWq5rVLom4",
marks=pytest.mark.altcoin,
+ id="Litecoin-m/44h/2h/0h/0/0",
),
pytest.param(
"Litecoin",
0x019DA462,
parse_path("m/44h/2h/10h/1/100"),
"Ltub2dcb6Nghj3kwaC2g3TtPgFzMSm7LXfe4mijFYsvEtxXu18vicTB4kYc9z6jGVMpdYhMScNhVY1naQYALnM2x4fvaGzAAGgcuZ89nFyyLhiK",
marks=pytest.mark.altcoin,
+ id="Litecoin-m/44h/2h/10h/1/100",
),
)
VECTORS_INVALID = ( # coin_name, path
- ("Bitcoin", parse_path("m/44h/1h/0h")), # Testnet path on Bitcoin
- ("Testnet", parse_path("m/44h/0h/0h")), # Bitcoin path on Testnet
- ("Bitcoin", parse_path("m/40h/0h/0h")), # Unknown purpose
- ("Bitcoin", parse_path("m/13h/0h/0h")), # SLIP-13 path
+ # Testnet path on Bitcoin
+ pytest.param("Bitcoin", parse_path("m/44h/1h/0h"), id="testnet_path_on_bitcoin"),
+ # Bitcoin path on Testnet
+ pytest.param("Testnet", parse_path("m/44h/0h/0h"), id="bitcoin_path_on_testnet"),
+ # Unknown purpose
+ pytest.param("Bitcoin", parse_path("m/40h/0h/0h"), id="unknown_purpose"),
+ # SLIP-13 path
+ pytest.param("Bitcoin", parse_path("m/13h/0h/0h"), id="slip13_path"),
# Bitcoin path on Litecoin
- pytest.param("Litecoin", parse_path("m/44h/0h/0h"), marks=pytest.mark.altcoin),
+ pytest.param(
+ "Litecoin",
+ parse_path("m/44h/0h/0h"),
+ marks=pytest.mark.altcoin,
+ id="bitcoin_path_on_litecoin",
+ ),
# Segwit path on Bitcoin Cash
- pytest.param("Bcash", parse_path("m/84h/145h/0h"), marks=pytest.mark.altcoin),
+ pytest.param(
+ "Bcash",
+ parse_path("m/84h/145h/0h"),
+ marks=pytest.mark.altcoin,
+ id="segwit_path_on_bcash",
+ ),
)
@@ -193,25 +218,29 @@ def test_slip25_path(session: Session):
VECTORS_SCRIPT_TYPES = ( # script_type, xpub, xpub_ignored_magic
- (
+ pytest.param(
None,
"xpub6BiVtCp7ozsRo7kaoYNrCNAVJwPYTQHjoXFD3YS797S55Y42sm2raxPrXQWAJodn7aXnHJdhz433ZJDhyUztHW55WatHeoYUVqui8cYNX8y",
"xpub6BiVtCp7ozsRo7kaoYNrCNAVJwPYTQHjoXFD3YS797S55Y42sm2raxPrXQWAJodn7aXnHJdhz433ZJDhyUztHW55WatHeoYUVqui8cYNX8y",
+ id="no_script_type",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDADDRESS,
"xpub6BiVtCp7ozsRo7kaoYNrCNAVJwPYTQHjoXFD3YS797S55Y42sm2raxPrXQWAJodn7aXnHJdhz433ZJDhyUztHW55WatHeoYUVqui8cYNX8y",
"xpub6BiVtCp7ozsRo7kaoYNrCNAVJwPYTQHjoXFD3YS797S55Y42sm2raxPrXQWAJodn7aXnHJdhz433ZJDhyUztHW55WatHeoYUVqui8cYNX8y",
+ id="SPENDADDRESS",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDP2SHWITNESS,
"ypub6WYmBsV2xgQueQwhduAUQTFzUuXzQ2HEidmRpwKzX7ox8dsG8RCRD23zYcTkJiHhXDeb2nEGSiPbSaqGhBQu5jkgNvaiEiMxmZyMXEvfNco",
"xpub6BiVtCp7ozsRo7kaoYNrCNAVJwPYTQHjoXFD3YS797S55Y42sm2raxPrXQWAJodn7aXnHJdhz433ZJDhyUztHW55WatHeoYUVqui8cYNX8y",
+ id="SPENDP2SHWITNESS",
),
- (
+ pytest.param(
messages.InputScriptType.SPENDWITNESS,
"zpub6qP2VY9x7MxPVi8pUFx6cYMVesgSLeGjdkHecLDsu8BqBjgVP5Myq5i8ZpRLJcwcvrmPnFppuNk9KsSqQspusySHFGH8pdBT3J2zujqcVuz",
"xpub6BiVtCp7ozsRo7kaoYNrCNAVJwPYTQHjoXFD3YS797S55Y42sm2raxPrXQWAJodn7aXnHJdhz433ZJDhyUztHW55WatHeoYUVqui8cYNX8y",
+ id="SPENDWITNESS",
),
)
### tests/device_tests/bitcoin/test_getpublickey_curve.py
@@ -25,30 +25,35 @@
PATH_PUBLIC = parse_path("m/17h/0h/1h/2h/3h/42")
VECTORS = ( # curve, path, pubkey
- (
+ pytest.param(
"secp256k1",
PATH_PRIVATE,
"02f65ce170451f66f46daf9486b0cf266bd199a3e67f734e469556745a78d254ee",
+ id="secp256k1-private",
),
- (
+ pytest.param(
"secp256k1",
PATH_PUBLIC,
"0212f4629f4f224db0f778ca68abd1c53e21dd02e76dbd1f7312788544b5b1e042",
+ id="secp256k1-public",
),
- (
+ pytest.param(
"nist256p1",
PATH_PRIVATE,
"0324c6860c25cdf7a8c103666662ac6183bf5a181a3341ea4130dcc6fdee7919e4",
+ id="nist256p1-private",
),
- (
+ pytest.param(
"nist256p1",
PATH_PUBLIC,
"03b93f7e6c777143ad4eeb590aaa7cdcd95980cf68d3f75dc2c31ca637ec50c49b",
+ id="nist256p1-public",
),
- (
+ pytest.param(
"ed25519",
PATH_PRIVATE,
"002e28dc0346d6d30d4e33f53c47f2fa97f3cfb5e80fc30fa3570fccf30652718a",
+ id="ed25519-private",
),
)
### tests/device_tests/bitcoin/test_nonstandard_paths.py
@@ -26,67 +26,85 @@
VECTORS = ( # path, script_types
# GreenAddress A m/[1,4]/address_index
- (
+ pytest.param(
"m/4/255",
(
messages.InputScriptType.SPENDADDRESS,
messages.InputScriptType.SPENDWITNESS,
messages.InputScriptType.SPENDP2SHWITNESS,
),
+ id="greenaddress_a",
),
# GreenAddress B m/3'/[1-100]'/[1,4]/address_index
- (
+ pytest.param(
"m/3h/100h/4/255",
(
messages.InputScriptType.SPENDADDRESS,
messages.InputScriptType.SPENDWITNESS,
messages.InputScriptType.SPENDP2SHWITNESS,
),
+ id="greenaddress_b",
),
# GreenAdress Sign A m/1195487518
- (
+ pytest.param(
"m/1195487518",
(
messages.InputScriptType.SPENDADDRESS,
messages.InputScriptType.SPENDWITNESS,
messages.InputScriptType.SPENDP2SHWITNESS,
),
+ id="greenaddress_sign_a",
),
# GreenAdress Sign B m/1195487518/6/address_index
- (
+ pytest.param(
"m/1195487518/6/255",
(
messages.InputScriptType.SPENDADDRESS,
messages.InputScriptType.SPENDWITNESS,
messages.InputScriptType.SPENDP2SHWITNESS,
),
+ id="greenaddress_sign_b",
),
# Casa m/49/coin_type/account/change/address_index
- (
+ pytest.param(
"m/49/0/63/0/255",
(messages.InputScriptType.SPENDP2SHWITNESS,),
+ id="casa",
),
)
# 2-of-3 multisig, first path is ours
VECTORS_MULTISIG = ( # paths, address_index
# GreenAddress A m/[1,4]/address_index
- (("m/1", "m/1", "m/4"), [255]),
+ pytest.param(("m/1", "m/1", "m/4"), [255], id="greenaddress_a"),
# GreenAddress B m/3'/[1-100]'/[1,4]/address_index
- (("m/3h/100h/1", "m/3h/99h/1", "m/3h/98h/1"), [255]),
+ pytest.param(
+ ("m/3h/100h/1", "m/3h/99h/1", "m/3h/98h/1"), [255], id="greenaddress_b"
+ ),
# GreenAdress Sign A m/1195487518
- (("m/1195487518", "m/1195487518", "m/1195487518"), []),
+ pytest.param(
+ ("m/1195487518", "m/1195487518", "m/1195487518"), [], id="greenaddress_sign_a"
+ ),
# GreenAdress Sign B m/1195487518/6/address_index
- (("m/1195487518/6", "m/1195487518/6", "m/1195487518/6"), [255]),
+ pytest.param(
+ ("m/1195487518/6", "m/1195487518/6", "m/1195487518/6"),
+ [255],
+ id="greenaddress_sign_b",
+ ),
# Unchained hardened m/45'/coin_type'/account'/[0-1000000]/change/address_index
- (
+ pytest.param(
("m/45h/0h/63h/1000000", "m/45h/0h/62h/1000000", "m/45h/0h/61h/1000000"),
[0, 255],
+ id="unchained_hardened",
),
# Unchained unhardened m/45'/coin_type/account/[0-1000000]/change/address_index
- (("m/45h/0/63/1000000", "m/45h/0/62/1000000", "m/45h/0/61/1000000"), [0, 255]),
+ pytest.param(
+ ("m/45h/0/63/1000000", "m/45h/0/62/1000000", "m/45h/0/61/1000000"),
+ [0, 255],
+ id="unchained_unhardened",
+ ),
# Casa Paths
- (("m/45h/0/60/1", "m/45h/1/60/0", "m/45h/2/60/0"), [255]),
+ pytest.param(("m/45h/0/60/1", "m/45h/1/60/0", "m/45h/2/60/0"), [255], id="casa"),
)
### tests/device_tests/bitcoin/test_signtx_prevhash.py
@@ -73,7 +73,13 @@ def _check_error_message(value: bytes, model: models.TrezorModel, message: str):
with_bad_prevhashes = pytest.mark.parametrize(
- "prev_hash", (b"", b"x", b"hello world", b"x" * 33)
+ "prev_hash",
+ (
+ pytest.param(b"", id="empty"),
+ pytest.param(b"x", id="1_byte"),
+ pytest.param(b"hello world", id="11_bytes"),
+ pytest.param(b"x" * 33, id="33_bytes"),
+ ),
)
### tests/device_tests/bitcoin/test_signtx_replacement.py
@@ -358,45 +358,50 @@ def test_p2wpkh_finalize(session: Session):
@pytest.mark.parametrize(
"out1_amount, out2_amount, copayer_witness, fee_confirm, expected_tx",
(
- (
+ pytest.param(
# Scenario 1: No fee bump by sender or receiver.
10000 + 19899859, # out1: Receiver does not contribute to fee.
100000 - 10000 - 141, # out2: Original change.
"02483045022100eb74abb36f317d707c36d6fe1f4f73192d54417b9d5cd274e0077590833aad0a02206cf26621706aaf232c48a139910de71f7dbf17f3fb6af52a7222d19d88041e8b012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb011012",
False,
"010000000001026bb504f52d634e67966da4c0c3f930634a3bda329881b58aa16e855941b2b5e400000000005a2417009e506939e23ad82a559f2c5e812d13788644e1e0017afd5c40383ab01e87f9700100000000ffffffff02e3cc2f0100000000160014fb7e49f4017dc951615dea221b66626189aa43b9035f0100000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe802483045022100fd695bb0b5d07f0578ba56cb385b7662b98a1eb7d61ac25eaa565376ebd042de02201dc5209206d5d4c1bb79f9278a330767bf73afa774cd6a8331068d430bc95e50012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86202483045022100eb74abb36f317d707c36d6fe1f4f73192d54417b9d5cd274e0077590833aad0a02206cf26621706aaf232c48a139910de71f7dbf17f3fb6af52a7222d19d88041e8b012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb0110125a241700",
+ id="no_fee_bump",
),
- (
+ pytest.param(
# Scenario 2: Sender fee bump only.
10000 + 19899859, # out1: Receiver does not contribute to fee.
100000 - 10000 - 200, # out2: Sender bumps fee from 141 to 200.
"02483045022100af3a874c966ee595321e8699e7157f0b21f2542ddcdcafd06a9c2b4fd75e998b02206daecf235b5eb3c9dac088c904774cc0a61ac601c840efc5cbe00f99e1979a09012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb011012",
True,
"010000000001026bb504f52d634e67966da4c0c3f930634a3bda329881b58aa16e855941b2b5e400000000005a2417009e506939e23ad82a559f2c5e812d13788644e1e0017afd5c40383ab01e87f9700100000000ffffffff02e3cc2f0100000000160014fb7e49f4017dc951615dea221b66626189aa43b9c85e0100000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe8024730440220524e0f020a4ed910fa8e654feca8a2d54962e9691b2e1be9648685fbe84d900402203971dbba53400ed93d69dc5811cc0c7b3d368ffa9ba92c746fda8925bd5f556f012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86202483045022100af3a874c966ee595321e8699e7157f0b21f2542ddcdcafd06a9c2b4fd75e998b02206daecf235b5eb3c9dac088c904774cc0a61ac601c840efc5cbe00f99e1979a09012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb0110125a241700",
+ id="sender_fee_bump",
),
- (
+ pytest.param(
# Scenario 3: Receiver fee bump.
10000 + 19899859 - 59, # out1: Receiver contributes 59 to fee.
100000 - 10000 - 141, # out2: Sender does not bump fee.
"0248304502210097a42b35d3d16fa169667cd85a007eaf6b674495634b120d9fb62d72a0df872402203d0cdf746fd7a668276f93f660a9d052bc8a5d7cd8fea36073de38da463ece85012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb011012",
False,
"010000000001026bb504f52d634e67966da4c0c3f930634a3bda329881b58aa16e855941b2b5e400000000005a2417009e506939e23ad82a559f2c5e812d13788644e1e0017afd5c40383ab01e87f9700100000000ffffffff02a8cc2f0100000000160014fb7e49f4017dc951615dea221b66626189aa43b9035f0100000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe802473044022002bdb052c49648cd7a9488080c5489f89cff52b752acfcabf6e130d2e9f9fe3902202433f50b8b2a0cc4d463c44c0f24812e0b7f2f5c8f2ec67137694a934335b60f012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f8620248304502210097a42b35d3d16fa169667cd85a007eaf6b674495634b120d9fb62d72a0df872402203d0cdf746fd7a668276f93f660a9d052bc8a5d7cd8fea36073de38da463ece85012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb0110125a241700",
+ id="receiver_fee_bump",
),
- (
+ pytest.param(
# Scenario 4: Receiver pays entire fee.
10000 + 19899859 - 141, # out1: Receiver pays entire original fee of 141.
100000 - 10000, # out2: Sender pays no fee.
"024730440220753f53049ca43d55f65633d3f1a8fe0464f24f780070db27474fd48d161b958302204a08e2956ac9bf1bdc762eb19f77cab5aa22ab24e058f31b8db2b878c875be74012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb011012",
False,
"010000000001026bb504f52d634e67966da4c0c3f930634a3bda329881b58aa16e855941b2b5e400000000005a2417009e506939e23ad82a559f2c5e812d13788644e1e0017afd5c40383ab01e87f9700100000000ffffffff0256cc2f0100000000160014fb7e49f4017dc951615dea221b66626189aa43b9905f0100000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe802483045022100e7f8b2d226cf98ab342c99d1bd51728661c8a81c94b0e198ea423c3cf704c29402203f522364bd1e4221bd5aa2db2364f1618b67fcddf54a838d8994b9f51f0c1c0c012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f862024730440220753f53049ca43d55f65633d3f1a8fe0464f24f780070db27474fd48d161b958302204a08e2956ac9bf1bdc762eb19f77cab5aa22ab24e058f31b8db2b878c875be74012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb0110125a241700",
+ id="receiver_pays_fee",
),
- (
+ pytest.param(
# Scenario 5: Receiver bumps and pays entire fee.
10000 + 19899859 - 200, # out1: Receiver bumps fee from 141 to 200.
100000 - 10000, # out2: Sender pays no fee.
"02483045022100aa1b91fb25cc9a0ace45db3dfae5d0beffdda4b76ccd4f362b460729efdf78b502206ed6de7fb6cdacdddd90f184416a46ea692f4a656a26702665bf2db1ef080a03012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb011012",
False,
"010000000001026bb504f52d634e67966da4c0c3f930634a3bda329881b58aa16e855941b2b5e400000000005a2417009e506939e23ad82a559f2c5e812d13788644e1e0017afd5c40383ab01e87f9700100000000ffffffff021bcc2f0100000000160014fb7e49f4017dc951615dea221b66626189aa43b9905f0100000000001600141d03a4d2167961b853d6cadfeab08e4937c5dfe802473044022075c504c90351394d0d019bc5022f860ecb33c0fcbf3b448b97d03169d1605427022007f0330591652a9a4a36417dc1477c8242abcc5110b312dfffc04df06901979c012103adc58245cf28406af0ef5cc24b8afba7f1be6c72f279b642d85c48798685f86202483045022100aa1b91fb25cc9a0ace45db3dfae5d0beffdda4b76ccd4f362b460729efdf78b502206ed6de7fb6cdacdddd90f184416a46ea692f4a656a26702665bf2db1ef080a03012102d587bc96e0ceab05f27401d66dc3e596ba02f2c0d7b018b5f80eebfaeb0110125a241700",
+ id="receiver_bumps_and_pays_fee",
),
),
)
### tests/device_tests/bitcoin/test_signtx_taproot.py
@@ -389,13 +389,22 @@ def attack_processor(msg):
"address",
(
# SegWit v1 pubkey not on the curve.
- "tb1pam775nxmvam4pfpqlm5q06k0y84e3x9w0xuhdpmxuna2qj3dfg6qy2pq29",
+ pytest.param(
+ "tb1pam775nxmvam4pfpqlm5q06k0y84e3x9w0xuhdpmxuna2qj3dfg6qy2pq29",
+ id="pubkey_not_on_curve",
+ ),
# SegWit v1 invalid address length.
- "tb1plycg5qvjtrp3qjf5f7zl382j9x6nrjz9n0dh50",
+ pytest.param("tb1plycg5qvjtrp3qjf5f7zl382j9x6nrjz9n0dh50", id="invalid_length"),
# Unrecognized SegWit version.
- "tb1zlycg5qvjtrp3qjf5f7zl382j9x6nrjz9sdhenvyxq8c3808qxmusxanpxu",
+ pytest.param(
+ "tb1zlycg5qvjtrp3qjf5f7zl382j9x6nrjz9sdhenvyxq8c3808qxmusxanpxu",
+ id="unrecognized_segwit_version",
+ ),
# SegWit v1 pubkey x-coordinate exceeds the field size.
- "tb1pllllllllllllllllllllllllllllllllllllllllllllallllscqgl4zhn",
+ pytest.param(
+ "tb1pllllllllllllllllllllllllllllllllllllllllllllallllscqgl4zhn",
+ id="pubkey_x_exceeds_field_size",
+ ),
),
)
def test_send_invalid_address(session: Session, address: str):
### tests/device_tests/misc/test_msg_getentropy.py
@@ -22,8 +22,8 @@
from trezorlib import misc
from trezorlib.debuglink import DebugSession as Session
-ENTROPY_LENGTHS_POW2 = [2**l for l in range(10)]
-ENTROPY_LENGTHS_POW2_1 = [2**l + 1 for l in range(10)]
+ENTROPY_LENGTHS_POW2 = [pytest.param(2**l, id=f"2^{l}") for l in range(10)]
+ENTROPY_LENGTHS_POW2_1 = [pytest.param(2**l + 1, id=f"2^{l}+1") for l in range(10)]
ENTROPY_LENGTHS = ENTROPY_LENGTHS_POW2 + ENTROPY_LENGTHS_POW2_1
### tests/device_tests/monero/test_getaddress.py
@@ -24,17 +24,20 @@
from ...input_flows import InputFlowShowAddressQRCode
TEST_VECTORS = [
- (
+ pytest.param(
"m/44h/128h/0h",
b"4Ahp23WfMrMFK3wYL2hLWQFGt87ZTeRkufS6JoQZu6MEFDokAQeGWmu9MA3GFq1yVLSJQbKJqVAn9F9DLYGpRzRAEXqAXKM",
+ id="m/44h/128h/0h",
),
- (
+ pytest.param(
"m/44h/128h/1h",
b"44iAazhoAkv5a5RqLNVyh82a1n3ceNggmN4Ho7bUBJ14WkEVR8uFTe9f7v5rNnJ2kEbVXxfXiRzsD5Jtc6NvBi4D6WNHPie",
+ id="m/44h/128h/1h",
),
- (
+ pytest.param(
"m/44h/128h/2h",
b"47ejhmbZ4wHUhXaqA4b7PN667oPMkokf4ZkNdWrMSPy9TNaLVr7vLqVUQHh2MnmaAEiyrvLsX8xUf99q3j1iAeMV8YvSFcH",
+ id="m/44h/128h/2h",
),
]
### tests/device_tests/nostr/test_nostr.py
@@ -43,10 +43,12 @@
pytest.param(
LEAD_MONKEY_PUBKEY_HEX,
marks=pytest.mark.setup_client(mnemonic=LEAD_MONKEY_MNEMONIC),
+ id="lead_monkey",
),
pytest.param(
WHAT_BLEAK_PUBKEY_HEX,
marks=pytest.mark.setup_client(mnemonic=WHAT_BLEAK_MNEMONIC),
+ id="what_bleak",
),
]
@@ -123,7 +125,7 @@ def test_get_pubkey(session: Session, pubkey_hex: str):
@pytest.mark.parametrize("pubkey_hex", VECTORS)
-@pytest.mark.parametrize("event", TEST_EVENTS)
+@pytest.mark.parametrize("event", TEST_EVENTS, ids=("ascii", "unicode_and_escapes"))
def test_sign_event(session: Session, pubkey_hex: str, event: dict):
response = nostr.sign_event(session, event_to_pb(event))
### tests/device_tests/reset_recovery/test_recovery_slip39_advanced.py
@@ -35,12 +35,12 @@
]
# secrets generated using model T
+SECRET_20 = "c2d2e26ad06023c60145f150abe2dd2b"
+SECRET_33 = "c41d5cf80fed71a008a3a0ae0458ff0c6d621b1a5522bccbfedbcfad87005c06"
+
VECTORS = (
- (MNEMONIC_SLIP39_ADVANCED_20, "c2d2e26ad06023c60145f150abe2dd2b"),
- (
- MNEMONIC_SLIP39_ADVANCED_33,
- "c41d5cf80fed71a008a3a0ae0458ff0c6d621b1a5522bccbfedbcfad87005c06",
- ),
+ pytest.param(MNEMONIC_SLIP39_ADVANCED_20, SECRET_20, id="20_words"),
+ pytest.param(MNEMONIC_SLIP39_ADVANCED_33, SECRET_33, id="33_words"),
)
@@ -81,7 +81,7 @@ def test_extra_share_entered(session: Session):
_test_secret(
session,
shares=EXTRA_GROUP_SHARE + MNEMONIC_SLIP39_ADVANCED_20,
- secret=VECTORS[0][1],
+ secret=SECRET_20,
)
### tests/device_tests/test_msg_change_wipe_code_t1.py
@@ -182,7 +182,14 @@ def test_set_pin_to_wipe_code(session: Session):
assert isinstance(resp, messages.Address)
-@pytest.mark.parametrize("invalid_wipe_code", ("1204", "", WIPE_CODE_TOO_LONG))
+@pytest.mark.parametrize(
+ "invalid_wipe_code",
+ (
+ pytest.param("1204", id="invalid_digit"),
+ pytest.param("", id="empty"),
+ pytest.param(WIPE_CODE_TOO_LONG, id="too_long"),
+ ),
+)
def test_set_wipe_code_invalid(session: Session, invalid_wipe_code: str):
# Let's set the wipe code
ret = session.call_raw(messages.ChangeWipeCode())
### tests/device_tests/test_msg_changepin_t1.py
@@ -30,6 +30,15 @@
pytestmark = pytest.mark.models("legacy")
+with_invalid_pins = pytest.mark.parametrize(
+ "invalid_pin",
+ (
+ pytest.param("1204", id="invalid_digit"),
+ pytest.param("", id="empty"),
+ pytest.param(PIN_TOO_LONG, id="too_long"),
+ ),
+)
+
def _check_pin(session: Session, pin):
session.lock()
@@ -172,7 +181,7 @@ def test_change_mismatch(session: Session):
_check_pin(session, PIN4)
-@pytest.mark.parametrize("invalid_pin", ("1204", "", PIN_TOO_LONG))
+@with_invalid_pins
def test_set_invalid(session: Session, invalid_pin):
assert session.features.pin_protection is False
@@ -207,7 +216,7 @@ def test_set_invalid(session: Session, invalid_pin):
_check_no_pin(session)
-@pytest.mark.parametrize("invalid_pin", ("1204", "", PIN_TOO_LONG))
+@with_invalid_pins
@pytest.mark.setup_client(pin=PIN4)
def test_enter_invalid(session: Session, invalid_pin):
assert session.features.pin_protection is True
### tests/ui_tests/fixtures.json
[binary or diff unavailable]Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.