mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-12 09:01:29 +01:00
refactor: use thiserror to derive errors and update error messages (#344)
This commit is contained in:
committed by
GitHub
parent
50dd6bda19
commit
a27f9ad828
@@ -61,7 +61,10 @@ impl MerklePath {
|
||||
pub fn verify(&self, index: u64, node: RpoDigest, root: &RpoDigest) -> Result<(), MerkleError> {
|
||||
let computed_root = self.compute_root(index, node)?;
|
||||
if &computed_root != root {
|
||||
return Err(MerkleError::ConflictingRoots(vec![computed_root, *root]));
|
||||
return Err(MerkleError::ConflictingRoots {
|
||||
expected_root: *root,
|
||||
actual_root: computed_root,
|
||||
});
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user