mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2025-04-02 22:45:41 +00:00
improve error message in Proof::new to include actual lengths
This commit is contained in:
parent
74074dfa2f
commit
b05f46b9d1
@ -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