Skip to content

Commit 3da37c8

Browse files
committed
Merge #524: hexify for better error message
a0b001b hexify for better error message (Harshil Jani) Pull request description: This PR hexifies the Error implementation as requested in TODO. Let me know if this works and then I can remove the "TODO : Hexify this " Comment from there. Signed-off-by: Harshil Jani <[email protected]> ACKs for top commit: apoelstra: ACK a0b001b Tree-SHA512: 9ee5020104af93a8d06960c7627e7bf344d18f2f5570b6333935522c95d13499b4a67abb0153f85c06d376d79be189a3bc61f45254aa871fb74a7716b848ee77
2 parents 71f7f1b + a0b001b commit 3da37c8

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)