SFT-8192: rename the test double to Mock*, matching the rest of the suite
What changed, and why it matters
This commit only renames a test helper class from FakePSBT to MockPSBT inside a single unit-test file. No production code, behavior, or security logic changed.
No security action needed. This is a non-security test-code refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure identifier rename in ports/stm32/boards/Passport/modules/tests/unit/psbt_unsigned_txn.py. The class FakePSBT is renamed to MockPSBT, and all five call sites are updated accordingly. There are no functional changes to the PSBT parser, transaction serialization, or any firmware runtime code.
Changed components
ports/stm32/boards/Passport/modules/tests/unit/psbt_unsigned_txn.pyInspect captured patch +5 / −5
### ports/stm32/boards/Passport/modules/tests/unit/psbt_unsigned_txn.py
@@ -16,7 +16,7 @@
OUTPUT_VALUE = 1000
-class FakePSBT:
+class MockPSBT:
'''Just enough of a psbtObject for parse_txn() and the iterators to work on.'''
def __init__(self, raw):
@@ -58,7 +58,7 @@ def must_raise(exc_type, call):
# A compliant unsigned transaction parses, and the positions it records let the
# input and output iterators walk it.
-psbt = FakePSBT(ser_unsigned_txn(num_in=2, num_out=3))
+psbt = MockPSBT(ser_unsigned_txn(num_in=2, num_out=3))
psbtObject.parse_txn(psbt)
assert psbt.txn_version == 2
@@ -73,16 +73,16 @@ def must_raise(exc_type, call):
# the bare ValueError('CTxInWitness') that _skip_n_objs() used to raise once the
# parser reached the witness area.
must_raise(FatalPSBTIssue,
- lambda: psbtObject.parse_txn(FakePSBT(ser_unsigned_txn(witness=True))))
+ lambda: psbtObject.parse_txn(MockPSBT(ser_unsigned_txn(witness=True))))
# A zero input count is indistinguishable from the segwit marker, so it is caught on
# that path rather than by the 'no ins?' assertion. Either way it is rejected.
must_raise(FatalPSBTIssue,
- lambda: psbtObject.parse_txn(FakePSBT(ser_unsigned_txn(num_in=0))))
+ lambda: psbtObject.parse_txn(MockPSBT(ser_unsigned_txn(num_in=0))))
# Version checking is unaffected.
must_raise(AssertionError,
- lambda: psbtObject.parse_txn(FakePSBT(ser_unsigned_txn(version=3))))
+ lambda: psbtObject.parse_txn(MockPSBT(ser_unsigned_txn(version=3))))
# finalize() fills the witness area itself, so every input gets a fresh empty
# witness it can assign a stack to.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.