prevent dupe inputs for specific kind of path_mappers
What changed, and why it matters
This commit only changes test helper code that creates fake Bitcoin transactions for automated testing. It makes each fake transaction input use a slightly different placeholder identifier instead of reusing the same dummy identifier. There is no change to the actual COLDCARD firmware or wallet security code, and no indication this fixes a real-world vulnerability.
No security action required. Treat as a routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies three test fixtures in the testing/ directory (bip322.py, test_multisig.py, txn.py). Each fixture builds synthetic supply transactions with COutPoint values constructed from struct.pack('4Q', 0xdead, 0xbeef, 0, 0). The patch changes the last word from a constant 0 to the loop variable i, so each fake input gets a distinct outpoint. This is a test-quality improvement to avoid duplicate inputs when tests iterate over multiple signers or path mappers. No firmware source files are touched.
Changed components
testing/bip322.pytesting/test_multisig.pytesting/txn.pyInspect captured patch +4 / −4
diff --git a/testing/bip322.py b/testing/bip322.py
index 2aecb05..3152a73 100644
--- a/testing/bip322.py
+++ b/testing/bip322.py
@@ -111,7 +111,7 @@ def bip322_txn(dev, pytestconfig, create_msg_file):
to_spend = CTransaction()
to_spend.nVersion = 0
out_point = COutPoint(
- uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, 0)),
+ uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, i)),
73
)
to_spend.vin = [CTxIn(out_point, nSequence=0xffffffff)]
@@ -213,7 +213,7 @@ def bip322_ms_txn(pytestconfig, create_msg_file):
to_spend = CTransaction()
to_spend.nVersion = 0
out_point = COutPoint(
- uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, 0)),
+ uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, i)),
73
)
to_spend.vin = [CTxIn(out_point, nSequence=0xffffffff)]
diff --git a/testing/test_multisig.py b/testing/test_multisig.py
index ce980aa..8bca38b 100644
--- a/testing/test_multisig.py
+++ b/testing/test_multisig.py
@@ -1350,7 +1350,7 @@ def fake_ms_txn(pytestconfig):
supply = CTransaction()
supply.nVersion = 2
out_point = COutPoint(
- uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, 0)),
+ uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, i)),
73
)
supply.vin = [CTxIn(out_point, nSequence=0xffffffff)]
diff --git a/testing/txn.py b/testing/txn.py
index 4c85e26..1d8988d 100644
--- a/testing/txn.py
+++ b/testing/txn.py
@@ -69,7 +69,7 @@ def fake_txn(dev, pytestconfig):
supply = CTransaction()
supply.nVersion = 2
out_point = COutPoint(
- uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, 0)),
+ uint256_from_str(struct.pack('4Q', 0xdead, 0xbeef, 0, i)),
73
)
supply.vin = [CTxIn(out_point, nSequence=0xffffffff)]
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.