{
 "number": 36694,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36694",
 "title": "test, bench: construct mempool inputs/outputs declaratively",
 "author": "alexanderwiederin",
 "author_association": "MEMBER",
 "created_at": "2026-10-29T15:04:56Z",
 "updated_at": "2026-10-29T16:23:42Z",
 "description_hash": "567d839ed0b943a3",
 "age_days": 3,
 "draft": false,
 "labels": [],
 "milestone": null,
 "base": "master",
 "head_sha": "30ad3ca75d5f544b8a730788fb37fc469cd82c4a",
 "head_ref": "declarative-mempool",
 "head_repo": "alexanderwiederin/bitcoin",
 "head_history": [],
 "additions": 132,
 "deletions": 155,
 "changed_files": 3,
 "commit_count": 3,
 "size_bucket": "M",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {},
   "conflicts": []
  }
 },
 "acks_parsed": {},
 "acks_tally": {
  "ack": 0,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "maflcko"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-29T15:03:27Z",
  "last_reviewer_activity": "2026-10-29T16:23:41Z",
  "last_reviewer": "maflcko",
  "author_silent_days": 3,
  "waiting_on_author_days": 3,
  "days_since_update": 3
 },
 "refs": {
  "mentioned": [
   36692
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 36692,
    "type": "issue",
    "state": "open",
    "merged": false,
    "merged_at": null,
    "title": "Declarative construction of test data"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "src/bench/mempool_eviction.cpp"
 ],
 "body": "Part of #36692. This keeps `CMutableTransaction` as the builder, since a `CTransaction` constructor taking inputs and outputs directly is still under discussion. Once one exists, these call sites can be converted to construct `CTransaction` directly.\n\nThis PR covers the mempool-related files.\n\nThis change is test- and bench-only and does not change the constructed transactions.\n\nNotes for reviewers: two spots in `rbf_tests` that modify an existing transaction as part of the test logic are intentionally left unchanged.",
 "commits": [
  {
   "sha": "b7abd88f0f2838b26a09a30e4aa23f18806b962f",
   "date": "2026-10-29T15:03:27Z",
   "message": "test: construct mempool_tests inputs/outputs declaratively\n\nReplace the field-by-field construction of inputs and outputs in\nmempool_tests with COutPoint, CTxIn and CTxOut constructor calls.\n\nThe txChild loop variable in MempoolRemoveTest is changed to uint32_t to\navoid a narrowing conversion in COutPoint{}. The constructed\ntransactions are unchanged."
  },
  {
   "sha": "e56fbbfe5dafb5ae3d9049b1abb31ee374e5a626",
   "date": "2026-10-29T15:03:27Z",
   "message": "bench: construct mempool_eviction inputs/outputs declaratively\n\nReplace the field-by-field construction of inputs and outputs in\nMempoolEviction with COutPoint, CTxIn and CTxOut constructor calls.\n\nSince CTxIn has no witness constructor argument, the witnesses are added\nafter vin is replaced. The constructed transactions are unchanged."
  },
  {
   "sha": "30ad3ca75d5f544b8a730788fb37fc469cd82c4a",
   "date": "2026-10-29T15:03:27Z",
   "message": "test: construct rbf_tests make_tx inputs/outputs declaratively\n\nReplace resizing the vectors and assigning fields by index in make_tx\nwith appending constructed CTxIn and CTxOut elements. The witness is\nadded directly to the new input instead of through a temporary\nCScriptWitness. The constructed transactions are unchanged."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-29T16:23:41Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "src/bench/mempool_eviction.cpp",
   "commit": "30ad3ca75d5f544b8a730788fb37fc469cd82c4a",
   "in_reply_to": null,
   "text": "```suggestion\n    CMutableTransaction tx1{};\n```\n\nnit: There is no need to type the type twice. But depending on the outcome of https://github.com/bitcoin/bitcoin/issues/36692, this may be stale anyway. Let's wait a week or two on that issue.\n\nAlso, this pull conflicts with https://github.com/bitcoin/bitcoin/pull/36521, so let's wait for that to be merged first.",
   "id": "rc:4414978840",
   "url": "https://github.com/bitcoin/bitcoin/pull/36694#discussion_r4414978840",
   "hash": "c6fcc9935a755856",
   "edited": "2026-10-29T16:23:42Z"
  }
 ],
 "labels_log": [],
 "state_log": [],
 "text_chars": 1965,
 "text_tokens_estimate": 491,
 "changed_paths": [
  "src/bench/mempool_eviction.cpp",
  "src/test/mempool_tests.cpp",
  "src/test/rbf_tests.cpp"
 ],
 "files": [
  {
   "path": "src/bench/mempool_eviction.cpp",
   "add": 50,
   "del": 56
  },
  {
   "path": "src/test/mempool_tests.cpp",
   "add": 79,
   "del": 90
  },
  {
   "path": "src/test/rbf_tests.cpp",
   "add": 3,
   "del": 9
  }
 ],
 "test_lines": 287,
 "git": {
  "head": "30ad3ca75d5f544b8a730788fb37fc469cd82c4a",
  "head_matches_backup": true,
  "base": "6ed5aad06111177c39f9b9f07a52634476380ae1",
  "patch_id": "7bcd5287b28606b5",
  "commits": [
   {
    "sha": "b7abd88f0f",
    "subject": "test: construct mempool_tests inputs/outputs declaratively",
    "files": 1,
    "add": 79,
    "del": 90
   },
   {
    "sha": "e56fbbfe5d",
    "subject": "bench: construct mempool_eviction inputs/outputs declaratively",
    "files": 1,
    "add": 50,
    "del": 56
   },
   {
    "sha": "30ad3ca75d",
    "subject": "test: construct rbf_tests make_tx inputs/outputs declaratively",
    "files": 1,
    "add": 3,
    "del": 9
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "7bcd5287b28606b5",
 "input_hash": "8a82a6b1d19c4df6",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}