SFT-7352: resolve test registration conflict and pin testnet CBOR
What changed, and why it matters
This commit only reorganizes and strengthens a software test. It moves a test function to an earlier spot in a test list and replaces loose partial checks of test data with an exact full-value comparison. There is no change to the actual firmware code that runs on the Passport device, so users are not affected.
No security action needed. Treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff touches two test files. test_unit.py reorders test_blockstream so it runs before test_sign_psbt. unit/blockstream.py replaces three substring/byte assertions against a generated testnet CBOR blob with a single equality check against a fully specified expected hex string. No runtime firmware logic is modified.
Changed components
ports/stm32/boards/Passport/modules/tests/test_unit.pyports/stm32/boards/Passport/modules/tests/unit/blockstream.pyInspect captured patch +18 / −7
### ports/stm32/boards/Passport/modules/tests/test_unit.py
@@ -88,6 +88,10 @@ def test_ui(test):
assert test('ui.py') == b'OK'
+def test_blockstream(test):
+ assert test('blockstream.py') == b'OK'
+
+
def test_sign_psbt(test):
assert test('sign_psbt.py') == b'OK'
@@ -150,7 +154,3 @@ def test_psbt_change_validation(test):
def test_single_line_message(test):
assert test('single_line_message.py') == b'OK'
-
-
-def test_blockstream(test):
- assert test('blockstream.py') == b'OK'
### ports/stm32/boards/Passport/modules/tests/unit/blockstream.py
@@ -38,9 +38,20 @@
24,
0x90abcdef,
True)
-assert testnet_cbor[0] == 0xa2
-assert b'\x05\xd9\x01\x31\xa2\x01\x00\x02\x01' in testnet_cbor
-assert b'\x01\x86\x18\x54\xf5\x01\xf5\x18\x18\xf5' in testnet_cbor
+testnet_expected = unhexlify(
+ 'a2'
+ '011a12345678'
+ '0281d90134d90194d9012f'
+ 'a5'
+ '035821' + '02' + '11' * 32 +
+ '045820' + '22' * 32 +
+ '05d90131a201000201'
+ '06d90130a3'
+ '01861854f501f51818f5'
+ '021a12345678'
+ '0303'
+ '081a90abcdef')
+assert testnet_cbor == testnet_expected
assert BlockstreamWallet in supported_software_wallets
assert BlockstreamWallet['label'] == 'Blockstream'Why this scored 12/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.