From fec6aa51c69a2b21e0c79b7d8a89073e3a7f4ef5 Mon Sep 17 00:00:00 2001 From: ricecodekhmer <151774852+ricecodekhmer@users.noreply.github.com> Date: Wed, 30 Apr 2025 07:58:50 +0100 Subject: [PATCH] improve error message in Proof::new to include actual lengths (#362) --- common/append_merkle/src/proof.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/append_merkle/src/proof.rs b/common/append_merkle/src/proof.rs index f7386c6..db7ad04 100644 --- a/common/append_merkle/src/proof.rs +++ b/common/append_merkle/src/proof.rs @@ -13,7 +13,7 @@ impl Proof { /// Creates new MT inclusion proof pub fn new(hash: Vec, path: Vec) -> Result> { if hash.len() != path.len() + 2 { - bail!("hash and path length mismatch"); + bail!("Proof::new: expected hash length = path.len() + 2, but got {} and {}", hash.len(), path.len()); } Ok(Proof { lemma: hash, path }) }