test: construct miniminer_tests inputs/outputs declaratively #36923

Manually merged
yuvicc merged 1 commit from test-declarative-miniminer into master 2026-12-01 14:09:52 +00:00 AGit
yuvicc commented 2026-11-20 05:13:54 +00:00 (Migrated from github.com)

Part of #36692: This replaces the resize-then-assign construction of transaction inputs and outputs in the make_tx helper of miniminer_tests with CTxIn and CTxOut ctor calls.

This change is test-only and does not change the constructed transactions

Part of #36692: This replaces the resize-then-assign construction of transaction inputs and outputs in the `make_tx` helper of `miniminer_tests` with `CTxIn` and `CTxOut` ctor calls. This change is test-only and does not change the constructed transactions
DrahtBot commented 2026-11-20 05:14:04 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK maflcko, janb84, musaHaruna

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36923 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36923.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36923#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [maflcko](https://github.com/bitcoin/bitcoin/pull/36923#issuecomment-7045346650), [janb84](https://github.com/bitcoin/bitcoin/pull/36923#pullrequestreview-6036998935), [musaHaruna](https://github.com/bitcoin/bitcoin/pull/36923#pullrequestreview-6132810901) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

I found no actionable issues in this static review.


Reviewed: 4cddbcf534eb · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:3705f06c6a27c475c77f2533c4d016ac03c829c839b7b538bba5e4768ccf54f1:1ed10c4979af6fc548d6b8d4534d505e02e84ac4b0aa4f8633555b2ba75119e8 --> <!-- ralph-base:079437cca7a8e2997a6dcd83ad38350014352544 --> <!-- ralph-head:4cddbcf534eba28e7c9755d1701655429a843879 --> <!-- ralph-case:6d25e5c5de265a2ce04f204ba9e99b20575a8f6161bbf36d7941dc9bb22b90bf --> I found no actionable issues in this static review. <!-- Review tier: routine --> --- Reviewed: [`4cddbcf534eb`](<https://git.fish.foo/bitcoin/bitcoin/commit/4cddbcf534eba28e7c9755d1701655429a843879>) · [Review report](<https://review.fish.foo/report/36923-4cddbcf534eba28e7c9755d1701655429a843879-2868-1.html>) · [Previous reports](<https://review.fish.foo/traces/36923/>) [permalink](<https://review.fish.foo/report/36923-4cddbcf534eba28e7c9755d1701655429a843879-2868-1.html>)
maflcko commented 2026-11-20 16:52:51 +00:00 (Migrated from github.com)

What is the current status/progress of the project? 6-line single-commit pull requests seem a bit too small and noisy. I understand everything in one pull may not work out, but maybe next time you can combine the smaller ones?

review ACK 4cddbcf534 🎛

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: review ACK 4cddbcf534eba28e7c9755d1701655429a843879 🎛
M1Bp1ez6rWsGsdo0L+TwxdLQjj1kaoUVlRKZZCDBHDmVmfaaItUwLfexjQ/uNVt7Ojjx7aZ8HXQ8FW4EIrZqBQ==
What is the current status/progress of the project? 6-line single-commit pull requests seem a bit too small and noisy. I understand everything in one pull may not work out, but maybe next time you can combine the smaller ones? review ACK 4cddbcf534eba28e7c9755d1701655429a843879 🎛 <details><summary>Show signature</summary> Signature: ``` untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= trusted comment: review ACK 4cddbcf534eba28e7c9755d1701655429a843879 🎛 M1Bp1ez6rWsGsdo0L+TwxdLQjj1kaoUVlRKZZCDBHDmVmfaaItUwLfexjQ/uNVt7Ojjx7aZ8HXQ8FW4EIrZqBQ== ``` </details>
janb84 (Migrated from github.com) reviewed 2026-11-24 09:50:11 +00:00
janb84 (Migrated from github.com) left a comment

ACK 4cddbcf534

A nice small cleanup that fits the series.
The diff is short, the transactions are unchanged. LGTM.

(I tried a couple of alternatives to make vin fully declarative. Not happy with the alternative and I think this is the best option until we get the C++23 range::to option or shim)

ACK 4cddbcf534eba28e7c9755d1701655429a843879 A nice small cleanup that fits the series. The diff is short, the transactions are unchanged. LGTM. (I tried a couple of alternatives to make vin fully declarative. Not happy with the alternative and I think this is the best option until we get the C++23 range::to option or shim)
maflcko commented 2026-11-24 10:34:21 +00:00 (Migrated from github.com)

I don't think this needs C++23, it is possible in C++11 as well: tx.vin = std::vector<CTxIn>{inputs.begin(), inputs.end()};, which does a reserve+move

I don't think this needs C++23, it is possible in C++11 as well: `tx.vin = std::vector<CTxIn>{inputs.begin(), inputs.end()};`, which does a reserve+move
musaHaruna (Migrated from github.com) reviewed 2026-12-01 14:04:07 +00:00
musaHaruna (Migrated from github.com) left a comment

ACK 4cddbcf

Checked that the input constructor defaults match the previous initialization, and that output counts, values, scripts, and input ordering are preserved.

What is the current status/progress of the project? 6-line single-commit pull requests seem a bit too small and noisy. I understand everything in one pull may not work out, but maybe next time you can combine the smaller ones?

I've pushed test/declarative-fixture-construction on my fork, which groups three commits across nine files covering coin fixtures, transaction fixtures, and witness-commitment outputs.

@yuvicc, feel free to cherry-pick these commits into a combined PR if useful. I'll also look for other test files on upstream that still need these conversions and group those changes into further batches.

ACK [4cddbcf](https://github.com/bitcoin/bitcoin/pull/36923/changes/4cddbcf534eba28e7c9755d1701655429a843879) Checked that the input constructor defaults match the previous initialization, and that output counts, values, scripts, and input ordering are preserved. > What is the current status/progress of the project? 6-line single-commit pull requests seem a bit too small and noisy. I understand everything in one pull may not work out, but maybe next time you can combine the smaller ones? I've pushed [test/declarative-fixture-construction](https://github.com/musaHaruna/bitcoin/tree/test/declarative-fixture-construction) on my fork, which groups three commits across nine files covering coin fixtures, transaction fixtures, and witness-commitment outputs. @yuvicc, feel free to cherry-pick these commits into a combined PR if useful. I'll also look for other test files on upstream that still need these conversions and group those changes into further batches.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36923
No description provided.