Commit 72f9728
committed
Merge bitcoin#24343: Add descriptor_tests covering tr(), and fix minor bugs
0683f37 Add tr() descriptor unit tests (Pieter Wuille)
4b2e31a Bugfix: make ToPrivateString work with x-only keys (Pieter Wuille)
18ad54c Bugfix: set x-only flag when inferring pk() inside tr() (Pieter Wuille)
Pull request description:
This fixes two bugs in the current logic for `tr()` descriptors:
* ToPrivateString does not always work, because the provided private key may mismatch the parity of the x-only public key.
* The descriptors inferred for `pk()` inside `tr()` have the wrong x-only flag, leading to such descriptors generating the wrong scriptPubKey (roundtripping through ToString does fix it however, so this seems unobservable in the current code).
These were discovered while adding unit tests to descriptor_tests that cover various aspects of `tr()` descriptors, which are now also added here.
ACKs for top commit:
achow101:
ACK 0683f37
instagibbs:
ACK bitcoin@0683f37
jonatack:
Code review ACK 0683f37
Tree-SHA512: fc0e11b45da53054a108effff2029d67b64e508b160a6e22e00c98b506c39ec12ccc95afd21ea68a6c691eb62930afc7af18908f2fa3a954d102afdc67bc355a2 files changed
+72
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
| |||
1253 | 1261 | | |
1254 | 1262 | | |
1255 | 1263 | | |
1256 | | - | |
| 1264 | + | |
1257 | 1265 | | |
1258 | 1266 | | |
1259 | 1267 | | |
| |||
0 commit comments