Skip to content

Commit a0b001b

Browse files
committed
hexify for better error message
Signed-off-by: Harshil Jani <[email protected]> Implementing hex using bitcoin_hashes crate Signed-off-by: Harshil Jani <[email protected]> Using bitcoin::hashes path for hex Signed-off-by: Harshil Jani <[email protected]>
1 parent 71f7f1b commit a0b001b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,10 @@ impl fmt::Display for Error {
512512
match *self {
513513
Error::InvalidOpcode(op) => write!(f, "invalid opcode {}", op),
514514
Error::NonMinimalVerify(ref tok) => write!(f, "{} VERIFY", tok),
515-
Error::InvalidPush(ref push) => write!(f, "invalid push {:?}", push), // TODO hexify this
515+
Error::InvalidPush(ref push) => {
516+
write!(f, "invalid push ")?;
517+
bitcoin::hashes::hex::format_hex(push, f)
518+
},
516519
Error::Script(ref e) => fmt::Display::fmt(e, f),
517520
Error::AddrError(ref e) => fmt::Display::fmt(e, f),
518521
Error::CmsTooManyKeys(n) => write!(f, "checkmultisig with {} keys", n),

0 commit comments

Comments
 (0)