mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2025-11-03 16:17:27 +00:00
improve error message in Proof::new to include actual lengths (#362)
This commit is contained in:
parent
27bc9d1426
commit
fec6aa51c6
@ -13,7 +13,7 @@ impl<T: HashElement> Proof<T> {
|
|||||||
/// Creates new MT inclusion proof
|
/// Creates new MT inclusion proof
|
||||||
pub fn new(hash: Vec<T>, path: Vec<bool>) -> Result<Proof<T>> {
|
pub fn new(hash: Vec<T>, path: Vec<bool>) -> Result<Proof<T>> {
|
||||||
if hash.len() != path.len() + 2 {
|
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 })
|
Ok(Proof { lemma: hash, path })
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user