Commit db656db
committed
Merge bitcoin#19136: wallet: add parent_desc to getaddressinfo
de6b389 tests: Test getaddressinfo parent_desc (Andrew Chow)
e4ac869 rpc: Add parent descriptor to getaddressinfo output (Andrew Chow)
bbe4a36 wallet: Add GetDescriptorString to DescriptorScriptPubKeyMan (Andrew Chow)
9be1437 descriptors: Add ToNormalizedString and tests (Andrew Chow)
Pull request description:
Adds `parent_desc` field to the `getaddressinfo` RPC to export a public descriptor. Using the given address, `getaddressinfo` will look up which `DescriptorScriptPubKeyMan` can be used to produce that address. It will then return the descriptor for that `DescriptorScriptPubKeyMan` in the `parent_desc` field. The descriptor will be in a normalized form where the xpub at the last hardened step is derived so that the descriptor can be imported to other wallets. Tests are added to check that the correct descriptor is being returned for the wallet's addresses and that these descriptors can be imported and used in other wallets.
As part of this PR, a `ToNormalizedString` function is added to the descriptor classes. This really only has an effect on `BIP32PubkeyProvider`s that have hardened derivation steps. Tests are added to check that normalized descriptors are returned.
ACKs for top commit:
Sjors:
utACK de6b389
S3RK:
Tested ACK de6b389
jonatack:
Tested ACK de6b389 modulo a few minor comments
fjahr:
Code review ACK de6b389
meshcollider:
Tested ACK de6b389
Tree-SHA512: a633e4a39f2abbd95afd7488484cfa66fdd2651dac59fe59f2b80a0940a2a4a13acf889c534a6948903d701484a2ba1218e3081feafe0b9a720dccfa9e43ca2bFile tree
7 files changed
+219
-40
lines changed- src
- script
- test
- wallet
- test/functional
7 files changed
+219
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| |||
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
215 | 233 | | |
216 | 234 | | |
217 | 235 | | |
| |||
243 | 261 | | |
244 | 262 | | |
245 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
246 | 270 | | |
247 | 271 | | |
248 | 272 | | |
| |||
386 | 410 | | |
387 | 411 | | |
388 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
389 | 463 | | |
390 | 464 | | |
391 | 465 | | |
| |||
449 | 523 | | |
450 | 524 | | |
451 | 525 | | |
452 | | - | |
| 526 | + | |
453 | 527 | | |
454 | 528 | | |
455 | 529 | | |
456 | 530 | | |
457 | 531 | | |
458 | 532 | | |
459 | 533 | | |
460 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
461 | 537 | | |
462 | 538 | | |
463 | 539 | | |
| |||
467 | 543 | | |
468 | 544 | | |
469 | 545 | | |
470 | | - | |
| 546 | + | |
471 | 547 | | |
472 | 548 | | |
473 | 549 | | |
| |||
477 | 553 | | |
478 | 554 | | |
479 | 555 | | |
480 | | - | |
| 556 | + | |
481 | 557 | | |
482 | 558 | | |
483 | 559 | | |
484 | 560 | | |
485 | 561 | | |
486 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
487 | 570 | | |
488 | 571 | | |
489 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
0 commit comments