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()
insidetr()
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.