This commit is contained in:
hu55a1n1 2023-12-31 08:44:29 -08:00
parent 94c951e53b
commit 931c7b0d6f

View file

@ -24,13 +24,10 @@ impl CwVerifier<'_> {
return Err(ProofError::EmptyMerkleRoot);
}
let value = Cow::Borrowed(value);
let verified = self.0.verify_against_root(proofs, keys, &value, root)?;
if !verified {
return Err(ProofError::VerificationFailure);
}
Ok(())
self.0
.verify_against_root(proofs, keys, &Cow::Borrowed(value), root)?
.then_some(())
.ok_or(ProofError::VerificationFailure)
}
}