{
 "number": 36591,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36591",
 "title": "test: deduplicate PSBT unknown-field coverage in `rpc_psbt.py`",
 "author": "nebula-21",
 "author_association": "CONTRIBUTOR",
 "created_at": "2026-10-21T15:57:31Z",
 "updated_at": "2026-10-21T23:00:04Z",
 "description_hash": "167f5e8b5afa0d53",
 "age_days": 11,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "ef4310097bd651497a98a9d1bb59560a7055ae01",
 "head_ref": "test-dedup-psbt-unknown-fields",
 "head_repo": "nebula-21/bitcoin",
 "head_history": [
  {
   "t": "2026-10-21T20:11:42Z",
   "sha": "ef4310097bd651497a98a9d1bb59560a7055ae01"
  }
 ],
 "additions": 25,
 "deletions": 24,
 "changed_files": 1,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "Naomi-Gift",
      "url": "https://github.com/bitcoin/bitcoin/pull/36591#issuecomment-6328450439"
     }
    ]
   },
   "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": [
   "Naomi-Gift"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-21T20:12:29Z",
  "last_reviewer_activity": "2026-10-21T23:00:00Z",
  "last_reviewer": "Naomi-Gift",
  "author_silent_days": 11,
  "waiting_on_author_days": 11,
  "days_since_update": 11
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [],
 "body": "I've tested some mutations related to test coverage for PSBT unknown field merging and discovered an inconsistency.\n\nIf line 71 of `psbt.cpp` \"`unknown.insert(psbt.unknown.begin(), psbt.unknown.end());`\"  (inside `bool PartiallySignedTransaction::Merge(const PartiallySignedTransaction& psbt)` function) is removed then, the expected test fails: *\"Test that combining PSBTs preserves unknown fields with the same and with distinct values per map.\"*\n\nIf line 434 of `psbt.cpp` \"`unknown.insert(input.unknown.begin(), input.unknown.end());`\" (inside `bool PSBTInput::Merge(const PSBTInput& input)` function), is removed, a different unexpected test fails: \"*Test that unknown values are just passed through*\".\n\nIf line 537 of `psbt.cpp` \"`unknown.insert(output.unknown.begin(), output.unknown.end());`\" (inside `bool PSBTOutput::Merge(const PSBTOutput& output)` function), is removed, the expected test fails: \"*Test that combining PSBTs preserves unknown fields with the same and with distinct values per map.*\".\n\nThis PR solves this inconsistency.\nThe old code did 3 different things:\n1. Test the pass-through of unknown values for `walletprocesspsbt`.\n2. Combine two v0 PSBTs with different unknown input keys and check that both keys survive.\n3. Combine implicit v0 PSBT with explicit v0 and check that both keys survive.\n\nCase 2 is already fully covered by the existing `test_combinepsbt_preseves_unknown_fields` so keeping it is redundant and misleading.\n\nCommit 40eba5eb20ba0041a6328ba3482fcc26ddbe0185 moves the old code into a new method called `test_unknown_fields_passthrough` and commit ef4310097bd651497a98a9d1bb59560a7055ae01 removes the redundant code of Case 2 and moves Case 3 inside `test_combinepsbt_preserves_unknown_fields`.",
 "commits": [
  {
   "sha": "40eba5eb20ba0041a6328ba3482fcc26ddbe0185",
   "date": "2026-10-21T14:43:07Z",
   "message": "test: extract unknown fields passthrough to its own method"
  },
  {
   "sha": "ef4310097bd651497a98a9d1bb59560a7055ae01",
   "date": "2026-10-21T20:12:29Z",
   "message": "test: combine redundant PSBT unknown field merge cases into `test_combinepsbt_preserves_unknown_fields`"
  }
 ],
 "timeline": [
  {
   "t": "2026-10-21T20:11:42Z",
   "kind": "force_push",
   "who": "nebula-21",
   "commit": "ef4310097bd651497a98a9d1bb59560a7055ae01",
   "id": "push:ef4310097bd651497a98a9d1bb59560a7055ae01"
  },
  {
   "t": "2026-10-21T23:00:00Z",
   "kind": "comment",
   "who": "Naomi-Gift",
   "assoc": "NONE",
   "text": "tACK ef4310097bd651497a98a9d1bb59560a7055ae01\nrpc_psbt.py passes\nRemoved line 434 of psbt.cpp: on master the \"passed through\" test fails, on the PR the combine-unknown-fields test fails, as described\nAlso tried 71 and 537 as well, and all three are now caught by the same test",
   "id": "c:6328450439",
   "url": "https://github.com/bitcoin/bitcoin/pull/36591#issuecomment-6328450439",
   "hash": "53090e4acc2a556b",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-21T16:10:22Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-10-21T16:48:40Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-10-21T20:53:34Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 2246,
 "text_tokens_estimate": 561,
 "changed_paths": [
  "test/functional/rpc_psbt.py"
 ],
 "files": [
  {
   "path": "test/functional/rpc_psbt.py",
   "add": 25,
   "del": 24
  }
 ],
 "test_lines": 49,
 "git": {
  "head": "ef4310097bd651497a98a9d1bb59560a7055ae01",
  "head_matches_backup": true,
  "base": "4303f3b7f0775cdbbe77faddf142e1e44fa590ca",
  "patch_id": "20d399d2c76c7177",
  "commits": [
   {
    "sha": "40eba5eb20",
    "subject": "test: extract unknown fields passthrough to its own method",
    "files": 1,
    "add": 27,
    "del": 24
   },
   {
    "sha": "ef4310097b",
    "subject": "test: combine redundant PSBT unknown field merge cases into `test_combinepsbt_preserves_unknown_fields`",
    "files": 1,
    "add": 15,
    "del": 17
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "20d399d2c76c7177",
 "input_hash": "2136e40c723ade4b",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}