AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

Merge bitcoin/bitcoin#36788: test, bench: construct inputs/outputs declaratively in txpackage, duplicate_inputs and p2sh tests

Public commit record

What the developer wrote

Authored by merge-script

91/100 · Strong
Merge bitcoin/bitcoin#36788: test, bench: construct inputs/outputs declaratively in txpackage, duplicate_inputs and p2sh tests

a4a2647834ad0cc4576b2eb38bddf02c42081173 test: construct script_p2sh_tests inputs/outputs declaratively (yuvicc)
7fc7d26e7507ad753cbcab2698404debcf63ca71 bench: construct duplicate_inputs inputs/outputs declaratively (yuvicc)
5336eaa7fa70c55fe4a137df721e691e61b80131 test: construct txpackage_tests inputs/outputs declaratively (yuvicc)

Pull request description:

Part of #36692. Follow-up to #36750

Replaces field-by-field construction of inputs and outputs with `COutPoint`, `CTxIn` and `CTxOut` ctor calls in `txpackage_tests`, `bench/duplicate_inputs` and `script_p2sh_tests`.

`CMutableTransaction` is kept as the builder while a `CTransaction` constructor is discussed in #36696. Witnesses are still assigned after `vin`, since `CTxIn` has no witness argument yet.

Test-only; the constructed transactions are unchanged.

- `script_p2sh_tests`: two outputs created by `vout.resize(1)` never had a value, so their null `nValue` (`-1`) is now explicit.
- Intentional mutations are left as they are: the `scriptSig` swap in `sign`, the dummy signing in `ValidateInputsStandardness`, and the witness-only copies in `txpackage_tests` (`mtx_child2`, `mtx_parent2_v2`).

ACKs for top commit:
alexanderwiederin:
ACK a4a2647834a
purpleKarrot:
ACK a4a2647834ad0cc4576b2eb38bddf02c42081173
maflcko:
review ACK a4a2647834ad0cc4576b2eb38bddf02c42081173 👒
janb84:
ACK a4a2647834ad0cc4576b2eb38bddf02c42081173
jpk68:
ACK a4a2647834ad0cc4576b2eb38bddf02c42081173

Tree-SHA512: ca452697a5bcccfbed2778785906f75c22e95fea04a1e79fb2d6fdae80ebe4badf5d8cb49a8b6add6e80a480b4826436caaee43ec534d4e6aae22f6584935b86
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit is a cleanup of Bitcoin Core's internal test and benchmark code only. It changes how dummy transactions are built in three test files, making the code more readable without changing what the transactions actually are. There is no change to the live Bitcoin network code, no security fix, and no vulnerability introduced.

Recommended action

No action required. This is a non-security test refactor.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.