Skip to content

Commit 79a0e62

Browse files
committed
lib: add a String member to the BadDescriptor Error
It was not used, and it's so that we can return it at parse time for invalid checksums. Signed-off-by: Antoine Poinsot <[email protected]>
1 parent e9732e4 commit 79a0e62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ pub enum Error {
355355
/// Typechecking failed
356356
TypeCheck(String),
357357
/// General error in creating descriptor
358-
BadDescriptor,
358+
BadDescriptor(String),
359359
/// Forward-secp related errors
360360
Secp(bitcoin::secp256k1::Error),
361361
#[cfg(feature = "compiler")]
@@ -471,7 +471,7 @@ impl fmt::Display for Error {
471471
Error::CouldNotSatisfy => f.write_str("could not satisfy"),
472472
Error::BadPubkey(ref e) => fmt::Display::fmt(e, f),
473473
Error::TypeCheck(ref e) => write!(f, "typecheck: {}", e),
474-
Error::BadDescriptor => f.write_str("could not create a descriptor"),
474+
Error::BadDescriptor(ref e) => write!(f, "Invalid descriptor: {}", e),
475475
Error::Secp(ref e) => fmt::Display::fmt(e, f),
476476
Error::ContextError(ref e) => fmt::Display::fmt(e, f),
477477
#[cfg(feature = "compiler")]

0 commit comments

Comments
 (0)