descriptor: Use DescriptorError instead of Error when reasonable
Change the return type of the `descriptor!()` macro and `ToWalletDescriptor` to avoid having to map errors. Also introduce more checks to validate descriptors built using the macro.
This commit is contained in:
@@ -27,26 +27,19 @@
|
||||
/// Errors related to the parsing and usage of descriptors
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
//InternalError,
|
||||
//InvalidPrefix(Vec<u8>),
|
||||
//HardenedDerivationOnXpub,
|
||||
//MalformedInput,
|
||||
/// Invalid HD Key path, such as having a wildcard but a length != 1
|
||||
InvalidHDKeyPath,
|
||||
/// The provided descriptor doesn't match its checksum
|
||||
InvalidDescriptorChecksum,
|
||||
|
||||
//KeyParsingError(String),
|
||||
/// Error thrown while working with [`keys`](crate::keys)
|
||||
Key(crate::keys::KeyError),
|
||||
/// Error while extracting and manipulating policies
|
||||
Policy(crate::descriptor::policy::PolicyError),
|
||||
|
||||
//InputIndexDoesntExist,
|
||||
//MissingPublicKey,
|
||||
//MissingDetails,
|
||||
/// Invalid character found in the descriptor checksum
|
||||
InvalidDescriptorCharacter(char),
|
||||
|
||||
//CantDeriveWithMiniscript,
|
||||
/// BIP32 error
|
||||
BIP32(bitcoin::util::bip32::Error),
|
||||
/// Error during base58 decoding
|
||||
|
||||
Reference in New Issue
Block a user