{
 "number": 35619,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35619",
 "title": "test:  ExtendedPrivateKey follow-ups",
 "author": "rkrux",
 "author_association": "MEMBER",
 "created_at": "2026-06-29T14:35:03Z",
 "updated_at": "2026-09-11T02:44:18Z",
 "age_days": 80,
 "draft": false,
 "labels": [
  "Tests"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "a34861d280b3db81175b6692ba00ccc62edff52e",
 "head_ref": "deadcode",
 "head_repo": "rkrux/bitcoin",
 "head_history": [
  {
   "t": "2026-06-29T16:59:03Z",
   "sha": "f01505ab1db268ed940911f2fb301e9b431bdffe"
  },
  {
   "t": "2026-06-30T09:41:17Z",
   "sha": "6b0011630fe9a6ed1010fb49993a874c7477d800"
  },
  {
   "t": "2026-09-02T10:14:18Z",
   "sha": "a34861d280b3db81175b6692ba00ccc62edff52e"
  }
 ],
 "additions": 18,
 "deletions": 24,
 "changed_files": 4,
 "commit_count": 2,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "davidgumberg",
      "url": "https://github.com/bitcoin/bitcoin/pull/35619#issuecomment-5628666392"
     }
    ]
   },
   "conflicts": [
    {
     "number": 35377,
     "title": "wallet: Allow importing of descriptors without private keys when the wallet has the private keys",
     "author": "achow101"
    }
   ]
  }
 },
 "acks_parsed": {
  "davidgumberg": {
   "kind": "ack",
   "hash": null,
   "t": "2026-09-11T02:44:14Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 1,
  "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": [
   "Serafimov2350",
   "davidgumberg",
   "maflcko",
   "sedited"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-09-02T10:14:34Z",
  "last_reviewer_activity": "2026-09-11T02:44:14Z",
  "last_reviewer": "davidgumberg",
  "author_silent_days": 15,
  "waiting_on_author_days": 6,
  "days_since_update": 6
 },
 "refs": {
  "mentioned": [
   35543
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 35543,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2026-06-26",
    "title": "test: introduce ExtendedPrivateKey and ExtendedPublicKey classes"
   }
  ],
  "conflicts": [
   35377
  ]
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "test/functional/wallet_importdescriptors.py",
  "test/functional/wallet_taproot.py"
 ],
 "body": "Looks like a case was missed in PR #35543 that introduced the utility xprv\nand xpub classes.\n\nAlso, unify how to avoid the creation of the default wallet in nodes.",
 "commits": [
  {
   "sha": "3458837a0b76fb7f5d4c2f5d9ebb9bd7818794be",
   "date": "2026-09-02T10:14:03Z",
   "message": "test: use ExtendedPrivateKey in wallet_importdescriptors.py\n\nLooks like a case was missed in the previous PR 35543 that introduced\nthe utility xprv and xpub classes. This patch covers that remaining\ncase in the test."
  },
  {
   "sha": "a34861d280b3db81175b6692ba00ccc62edff52e",
   "date": "2026-09-02T10:14:08Z",
   "message": "test: unify how to avoid the creation of the default wallet in nodes\n\nIf test doesn't need the default wallet creation, then the more common\nway is to set the wallet_names argument instead of the providing a\ncustom implementation of the init_wallet method that's a no-op, which\ncan be confusing for the readers. Also there is a tendency for this\npattern to be copied over other tests that refer the existing ones,\nso unifying the pattern is in best interest of the readability of\nthe test framework."
  }
 ],
 "timeline": [
  {
   "t": "2026-06-29T14:51:37Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "I don't understand this pull request. You claim that it is dead code, but don't give a rationale for it.\n\nI read it as an alias for `self.wallet_names = []`. However, this test doesn't set `self.wallet_names`, so this code isn't dead?"
  },
  {
   "t": "2026-06-29T14:55:53Z",
   "kind": "comment",
   "who": "rkrux",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nWhy?"
  },
  {
   "t": "2026-06-29T16:44:08Z",
   "kind": "comment",
   "who": "rkrux",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nIt appears so! This is a method that's overriding the init_wallet method of the test framework to not create the default wallet that can either be named self.wallet_names[node] or self.default_wallet_name. This is the first time I'm seeing this overriden method in the tests as it's used rarely (there's only one other occurrence of this pattern).\n\nLet me see what I can do about this PR now because I got confused here."
  },
  {
   "t": "2026-06-29T16:59:03Z",
   "kind": "force_push",
   "who": "rkrux",
   "commit": "f01505ab1db268ed940911f2fb301e9b431bdffe"
  },
  {
   "t": "2026-06-29T17:02:44Z",
   "kind": "comment",
   "who": "rkrux",
   "assoc": "MEMBER",
   "text": "I've updated the PR to add the same comment as in wallet_listdescriptors.py.\n\nBut this PR has moved away from its original intention now, a direction that I\ndon't feel strongly about. So, will close this PR if reviewers don't find it worthwhile."
  },
  {
   "t": "2026-06-29T17:16:24Z",
   "kind": "review",
   "who": "Serafimov2350",
   "assoc": "NONE",
   "state": "COMMENTED",
   "commit": "f01505ab1db268ed940911f2fb301e9b431bdffe",
   "text": "borisserafimov6@gmail.com"
  },
  {
   "t": "2026-06-29T17:42:54Z",
   "kind": "comment",
   "who": "rkrux",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nI took this PR as an opportunity to also cover a use case that was missed in PR\n#35543, so I believe this PR is good to review now. Sorry for the initial confusion\ncaused."
  },
  {
   "t": "2026-06-30T06:09:53Z",
   "kind": "review_comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "path": "test/functional/wallet_taproot.py",
   "commit": "c2b9a7cc69ee00720e1a220f4dadd6f191fefda4",
   "in_reply_to": null,
   "text": "heh, I think your initial diff was a good step in the right direction. I think the function should still be removed from the two tests.\n\nHowever, it should set `self.wallet_names = ...` correctly instead, so that all tests use the same pattern.\n\nGenerally, it is better to use one pattern consistently, than trying to re-invent many different patterns to do the same thing and use all of them in the codebase mixed.\n\nMaybe the docstring of `init_wallet` could be adjusted to say:\n\n```py\n\"\"\"\nRefer to the self.wallet_names docstring on how to use this.\n\"\"\"\n```\n\n?"
  },
  {
   "t": "2026-06-30T09:41:17Z",
   "kind": "force_push",
   "who": "rkrux",
   "commit": "6b0011630fe9a6ed1010fb49993a874c7477d800"
  },
  {
   "t": "2026-06-30T09:43:46Z",
   "kind": "review_comment",
   "who": "rkrux",
   "assoc": "MEMBER",
   "path": "test/functional/wallet_taproot.py",
   "commit": "c2b9a7cc69ee00720e1a220f4dadd6f191fefda4",
   "in_reply_to": 3496534168,
   "text": "[quoted text omitted]\n\nYeah, this is what confused me initially. I have removed the custom implementation of initi_wallet and unified the pattern for not creating the default wallet in nodes.\n\n[quoted text omitted]\nDone this as well."
  },
  {
   "t": "2026-07-01T22:06:15Z",
   "kind": "review_comment",
   "who": "davidgumberg",
   "assoc": "MEMBER",
   "path": "test/functional/wallet_importdescriptors.py",
   "commit": "4da5619a6a666cd4b6b9af45dc82b27b0a28cdb0",
   "in_reply_to": null,
   "text": "nit:\n\n```diff\n+\n+            key_origin = f'[{root_fingerprint}/0h/0h/{i}]'\n+\n             bech32_addr_info = w1.getaddressinfo(received_addr)\n-            assert_equal(bech32_addr_info['desc'][:23], f'wpkh([{root_fingerprint}/0h/0h/{i}]')\n+            assert bech32_addr_info['desc'].startswith(f'wpkh({key_origin}')\n```\n\n  Full diff\n\n```suggestion\n            key_origin = f'[{root_fingerprint}/0h/0h/{i}]'\n\n            bech32_addr_info = w1.getaddressinfo(received_addr)\n            assert bech32_addr_info['desc'].startswith(f'wpkh({key_origin}')\n\n            shwpkh_addr = w1.getnewaddress('', 'p2sh-segwit')\n            shwpkh_addr_info = w1.getaddressinfo(shwpkh_addr)\n            assert shwpkh_addr_info['desc'].startswith(f'sh(wpkh({key_origin}')\n\n            pkh_addr = w1.getnewaddress('', 'legacy')\n            pkh_addr_info = w1.getaddressinfo(pkh_addr)\n            assert pkh_addr_info['desc'].startswith(f'pkh({key_origin}')\n```"
  },
  {
   "t": "2026-07-01T22:07:49Z",
   "kind": "comment",
   "who": "davidgumberg",
   "assoc": "MEMBER",
   "text": "crACK https://github.com/bitcoin/bitcoin/commit/6b0011630fe9a6ed1010fb49993a874c7477d800"
  },
  {
   "t": "2026-08-27T11:12:25Z",
   "kind": "comment",
   "who": "sedited",
   "assoc": "MEMBER",
   "text": "@maflcko can you take another look here?"
  },
  {
   "t": "2026-09-01T15:41:41Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nLooks like there is a nit in the first commit, so haven't looked, but the second commit lgtm."
  },
  {
   "t": "2026-09-01T18:29:19Z",
   "kind": "comment",
   "who": "davidgumberg",
   "assoc": "MEMBER",
   "text": "It is just a style nit to reuse the `key_origin` string."
  },
  {
   "t": "2026-09-02T10:14:18Z",
   "kind": "force_push",
   "who": "rkrux",
   "commit": "a34861d280b3db81175b6692ba00ccc62edff52e"
  },
  {
   "t": "2026-09-02T10:14:34Z",
   "kind": "review_comment",
   "who": "rkrux",
   "assoc": "MEMBER",
   "path": "test/functional/wallet_importdescriptors.py",
   "commit": "4da5619a6a666cd4b6b9af45dc82b27b0a28cdb0",
   "in_reply_to": 3509300814,
   "text": "Taken, thanks."
  },
  {
   "t": "2026-09-11T02:44:14Z",
   "kind": "comment",
   "who": "davidgumberg",
   "assoc": "MEMBER",
   "text": "reACK  https://github.com/bitcoin/bitcoin/pull/35619/commits/a34861d280b3db81175b6692ba00ccc62edff52e"
  }
 ],
 "labels_log": [
  {
   "t": "2026-06-29T14:35:06Z",
   "action": "labeled",
   "label": "Tests",
   "who": "DrahtBot"
  },
  {
   "t": "2026-06-29T17:40:31Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-06-29T18:43:11Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-06-29T16:59:24Z",
   "kind": "renamed",
   "who": "rkrux",
   "from": "test: remove dead code from wallet_taproot.py",
   "to": "test:  add comment in wallet_taproot.py"
  },
  {
   "t": "2026-06-29T17:40:31Z",
   "kind": "renamed",
   "who": "rkrux",
   "from": "test:  add comment in wallet_taproot.py",
   "to": "test:  ExtendedPrivateKey follow-ups"
  }
 ],
 "text_chars": 4255,
 "text_tokens_estimate": 1063,
 "changed_paths": [
  "test/functional/test_framework/test_framework.py",
  "test/functional/wallet_importdescriptors.py",
  "test/functional/wallet_listdescriptors.py",
  "test/functional/wallet_taproot.py"
 ],
 "files": [
  {
   "path": "test/functional/test_framework/test_framework.py",
   "add": 1,
   "del": 0
  },
  {
   "path": "test/functional/wallet_importdescriptors.py",
   "add": 15,
   "del": 17
  },
  {
   "path": "test/functional/wallet_listdescriptors.py",
   "add": 1,
   "del": 4
  },
  {
   "path": "test/functional/wallet_taproot.py",
   "add": 1,
   "del": 3
  }
 ],
 "test_lines": 42,
 "git": {
  "head": "a34861d280b3db81175b6692ba00ccc62edff52e",
  "head_matches_backup": true,
  "base": "e1290ce7f74b50f99932e7b83e414dec2732a8b9",
  "commits": [
   {
    "sha": "3458837a0b",
    "subject": "test: use ExtendedPrivateKey in wallet_importdescriptors.py",
    "files": 1,
    "add": 15,
    "del": 17
   },
   {
    "sha": "a34861d280",
    "subject": "test: unify how to avoid the creation of the default wallet in nodes",
    "files": 3,
    "add": 3,
    "del": 7
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "ce466575b62d6b79",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}