fix: return error when parsing xprv into DescriptorPublicKey#970
fix: return error when parsing xprv into DescriptorPublicKey#970trevarj wants to merge 1 commit into
Conversation
|
This feels a little dangerous to me. If the user provides secret data and then we irreversibly throw it away, could that cause a loss of the secret? |
Yeah, that's a good point. Using |
And given that descriptors are, at their core, a string representation of an output, Having said this, we may want to add a special error variant to |
|
We can also add an That could be used for the fuzztests so that they would pass. |
Why not just change the fuzz tests to use |
|
Yeah, good idea. |
63ebd13 to
66c9316
Compare
Refactor FromStr for DescriptorPublicKey so that it can parse a xprv/tprv but then error with a new variant `DescriptorKeyParseError::UnexpectedXPrivateKey` so that the user knows to use `Descriptor<DescriptorPublicKey>::parse_descriptor()` instead. Added test that reflects what was reported in the issues: bitcoinfuzz/bitcoinfuzz#70 rust-bitcoin#785
66c9316 to
1d22086
Compare
Refactor FromStr for DescriptorPublicKey so that it can parse a xprv/tprv but
then error with a new variant
DescriptorKeyParseError::UnexpectedXPrivateKeyso that the user knows to use
Descriptor<DescriptorPublicKey>::parse_descriptor()instead.Added test that reflects what was reported in the issues:
bitcoinfuzz/bitcoinfuzz#70
#785