firmware/testing
2025-11-25 11:14:36 -05:00
..
data fix name handling during migration 2025-10-31 02:46:21 +01:00
devtest SSSP (squashed) 2025-10-01 15:54:15 +02:00
.gitignore Validate TRNG using dieharder test suite 2021-03-16 14:06:36 -04:00
api.py env path for bitcoind for CC testing 2025-10-22 01:02:46 +02: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 improve taptree parser 2025-06-11 15:58:04 +02:00
bip39-vectors.json BIP39 passphrase additions, no UX yet 2019-03-27 11:00:43 -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 renames Multisig/Miniscript 2025-11-12 09:18:28 -05:00
conftest.py Key expression export 2025-11-13 11:23:28 -05:00
constants.py remove SIGHASH_DEFAULT from PSBT input after signing 2025-10-22 00:56:20 +02: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 sign with specific miniscript wallet + separate complex wallets from single sig wallets during signing (never sign with both) + show complex wallet name when signing with it 2025-07-26 13:48:37 +02: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 fix test_iss6743 after removal of SIGHASH_ALL from psbt input 2025-02-19 09:38:59 +01: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 preserve old multisig wallets for downgrade; execute multisig migration in boot sequence 2025-11-12 11:05:13 -05: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 SSSP (squashed) 2025-10-01 15:54:15 +02:00
test_bsms.py renames Multisig/Miniscript 2025-11-12 09:18:28 -05:00
test_ccc.py renames Multisig/Miniscript 2025-11-12 09:18:28 -05: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 improve taptree parser 2025-06-11 15:58:04 +02:00
test_ephemeral.py test fixes 2025-10-30 01:32:42 +01:00
test_export.py edge key expression additions 2025-11-13 11:23:28 -05:00
test_hobble.py renames Multisig/Miniscript 2025-11-12 09:18:28 -05:00
test_hsm.py renames Multisig/Miniscript 2025-11-12 09:18:28 -05:00
test_miniscript.py comment 2025-11-14 09:39:52 -05:00
test_msg.py improve taptree parser 2025-06-11 15:58:04 +02:00
test_multisig.py revert: nothing to sign here error message, instead just return unsigned PSBT 2025-11-17 14:40:27 -05: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 renames Multisig/Miniscript 2025-11-12 09:18:28 -05: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 fin 2025-10-30 13:16:10 +01:00
test_sssp.py test miniscript & SSSP 2025-10-20 20:02:00 +02:00
test_teleport.py renames Multisig/Miniscript 2025-11-12 09:18:28 -05:00
test_unit.py optimize PSBT class 2025-08-15 13:20:12 +02:00
test_upgrades.py multiprocess simulator 2025-06-11 16:56:31 +02:00
test_usb.py farewell pycoin 2024-05-27 13:14:31 -04:00
test_ux.py drop sighash only after modifiable flags are properly set for v2 PSBT 2025-10-22 02:56:55 +02:00
test_vdisk.py multiprocess simulator 2025-06-11 16:56:31 +02:00
txn.py check 2025-10-22 15:14:44 +02: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