firmware/testing
scgbckbone e630dd614f MuSig2
2026-03-23 10:16:49 -04:00
..
data fix name handling during migration 2025-10-31 02:46:21 +01:00
devtest MuSig2 2026-03-23 10:16:49 -04:00
.gitignore add ./debug/* 2026-03-16 13:48:28 -04:00
api.py MuSig2 2026-03-23 10:16:49 -04:00
authproxy.py bitcoin regtest 2022-05-23 15:19:48 +02:00
base58.py farewell pycoin 2024-05-27 13:14:31 -04:00
bech32.py Support for P2TR cases 2022-05-03 11:37:22 -04:00
bip32.py MuSig2 2026-03-23 10:16:49 -04:00
bip39-vectors.json BIP39 passphrase additions, no UX yet 2019-03-27 11:00:43 -04:00
bip322.py move 2026-03-16 13:48:28 -04:00
charcodes.py remove version.has_fatram, add version.supports_hsm 2023-12-05 12:30:39 +01:00
ckcc_protocol Making whole firmware public with single, signed commit. 2018-07-24 14:07:33 -04:00
clone_tests.py Mk hardware 2026-03-16 13:48:28 -04:00
conftest.py MuSig2 2026-03-23 10:16:49 -04:00
constants.py MuSig2 2026-03-23 10:16:49 -04:00
core_fixtures.py lower Mk4 default wrap-around from 16 to 10 (same as Q) 2025-10-01 15:58:50 +02:00
ctransaction.py farewell pycoin 2024-05-27 13:14:31 -04:00
descriptor.py fixes & optimization of get_my_deriv 2025-10-09 19:55:56 +02:00
helpers.py MuSig2 2026-03-23 10:16:49 -04:00
login_settings_tests.py fix login tests 2025-11-17 09:12:08 -05:00
Makefile dev squashed 2020-11-18 14:19:14 -05:00
msg.py upgrade msg signing 2025-02-19 09:36:05 +01:00
objstruct.py dev squashed 2020-11-18 14:19:14 -05:00
psbt.py MuSig2 2026-03-23 10:16:49 -04:00
pytest.ini SSSP (squashed) 2025-10-01 15:54:15 +02:00
README.md farewell pycoin 2024-05-27 13:14:31 -04:00
requirements.txt Bump requests from 2.32.3 to 2.32.4 in /testing 2025-06-11 16:27:27 +02:00
ripemd.py farewell pycoin 2024-05-27 13:14:31 -04:00
run_sim_tests.py MuSig2 2026-03-23 10:16:49 -04:00
seedless_tests.py multiprocess simulator 2025-06-11 16:56:31 +02:00
serialize.py farewell pycoin 2024-05-27 13:14:31 -04:00
sigheader.py Support firmware limiting itself to specific hardware revs 2020-01-21 09:53:56 -05:00
teleport_cli.py improve taptree parser 2025-06-11 15:58:04 +02:00
teleport_protocol.py improve taptree parser 2025-06-11 15:58:04 +02:00
test_640_der_pth_migration.py preserve old multisig wallets for downgrade; execute multisig migration in boot sequence 2025-11-12 11:05:13 -05:00
test_640_migration_name_clash.py bugfix: multisig migration only worked for KofK multisigs 2025-11-25 11:14:36 -05:00
test_640_miniscript_migration.py preserve old multisig wallets for downgrade; execute multisig migration in boot sequence 2025-11-12 11:05:13 -05:00
test_640_multisig_migration.py bugfix: multisig migration only worked for KofK multisigs 2025-11-25 11:14:36 -05:00
test_addr.py improve taptree parser 2025-06-11 15:58:04 +02:00
test_address_explorer.py a lot more fixes 2025-07-16 13:47:25 +02:00
test_attended.py fix test_multisig.py; proper handling of buttons 2024-02-09 08:46:34 -05:00
test_backup.py test fixes 2025-10-30 01:32:42 +01:00
test_bbqr.py multiprocess simulator 2025-06-11 16:56:31 +02:00
test_bip39pw.py Mk hardware 2026-03-16 13:48:28 -04:00
test_bip322.py MuSig2 2026-03-23 10:16:49 -04:00
test_bsms.py renames Multisig/Miniscript 2025-11-12 09:18:28 -05:00
test_ccc.py Mk hardware 2026-03-16 13:48:28 -04:00
test_change_pins.py mk4=Q rest fixed (sim tests) 2024-04-10 10:27:34 -04:00
test_decoders.py ownership: search particular named wallet via BIP-21 wallet query param 2025-10-01 17:06:43 +02:00
test_drv_entro.py USB send keystrokes for all BIP-85 secret types 2026-02-06 12:56:21 -05:00
test_ephemeral.py fix tests 2026-03-16 13:48:28 -04:00
test_export.py fixes 2026-03-16 13:48:28 -04:00
test_hobble.py WIF store testing 2026-03-16 13:48:28 -04:00
test_hsm.py Mk hardware 2026-03-16 13:48:28 -04:00
test_miniscript.py MuSig2 2026-03-23 10:16:49 -04:00
test_msg.py WIF store testing 2026-03-16 13:48:28 -04:00
test_multisig.py WIF store testing 2026-03-16 13:48:28 -04:00
test_musig2.py MuSig2 2026-03-23 10:16:49 -04:00
test_nfc.py multisig input/output address format 2025-10-04 13:35:03 +02:00
test_notes.py SSSP (squashed) 2025-10-01 15:54:15 +02:00
test_ownership.py WIF store testing 2026-03-16 13:48:28 -04:00
test_paper.py multiprocess simulator 2025-06-11 16:56:31 +02:00
test_pincodes.py mk4 se1 cases 2022-03-02 12:40:19 -05:00
test_pwsave.py multiprocess simulator 2025-06-11 16:56:31 +02:00
test_rng.py initial test fixing 2022-05-13 14:05:54 +02:00
test_rolls.py add root to path for pytest to find dice rolls code 2023-01-20 15:59:31 -05:00
test_se2.py SSSP (squashed) 2025-10-01 15:54:15 +02:00
test_seed_xor.py allow viewing QR codes for XOR split mnemonics 2025-11-20 10:57:50 -05:00
test_sign.py bugfix: disallow sighash DEFAULT out of taproot context 2026-03-16 14:00:00 -04:00
test_sssp.py Mk hardware 2026-03-16 13:48:28 -04:00
test_teleport.py MuSig2 2026-03-23 10:16:49 -04:00
test_unit.py MuSig2 2026-03-23 10:16:49 -04:00
test_upgrades.py Mk hardware 2026-03-16 13:48:28 -04:00
test_usb.py farewell pycoin 2024-05-27 13:14:31 -04:00
test_ux.py WIF tests, support paper wallet format 2026-03-16 13:48:28 -04:00
test_vdisk.py Mk hardware 2026-03-16 13:48:28 -04:00
test_wif.py taproot wif store signing 2026-03-16 13:48:28 -04:00
txn.py prevent dupe inputs for specific kind of path_mappers 2026-03-16 13:48:28 -04:00
xfp-miner.py farewell pycoin 2024-05-27 13:14:31 -04:00
xor.py Fluff 2023-03-31 11:12:14 -04:00
xpub.py farewell pycoin 2024-05-27 13:14:31 -04:00

Testing Code

None of this code ships on the product itself, but it does get used for testing purposes.

Dependencies

  • 7z

Crypto Backend

Background

  • pytest is used to track test cases and fixtures, etc
  • most test code is desktop (simulator), but it can also validate stuff from/to the device
  • some tests might only be possible in 'devmode': a unit that has booted w/ non-standard bootrom
  • some tests may be destructive for funds/seeds/wallets
  • most unit tests will work only on simulator because the useful hooks are too dangerous in product
  • you need a testnet bitcoind running for some tests (will be skipped if not present)

Command line args

  • pass argument "--sim" or "--dev" to select simulator or real device

  • will skip tests that are inappropriate

  • and/or use "marker" for bitcoind interaction: "-m bitcoind"

  • with "--dev" include "--manual" to require operator to press X/OK at times (also needs -s), so:

    --dev --manual -s

Marked Test Cases

  • test all QR code related cases with:

    py.test -m qrcode

  • txn signing where an unfinalized PSBT is created (low-R tests)

    py.test -m unfinalized

  • "bitcoind" which means test would be skipped if you don't have bitcoin core running locally (on testnet)

PSBT reference files

  • examples with IN_REDEEM_SCRIPT:

    data/2-of-2.psbt data/failed-ex.psbt data/filled_scriptsig.psbt data/multisig-single.psbt data/p2pkh+p2sh+outs.psbt data/p2pkh-p2sh-p2wpkh.psbt data/p2sh_p2wpkh.psbt data/worked-*.psbt