From 931c7b0d6f1c6fe050aa725b1ce7b8803ba4e473 Mon Sep 17 00:00:00 2001 From: hu55a1n1 Date: Sun, 31 Dec 2023 08:44:29 -0800 Subject: [PATCH] Cleanup --- utils/cw-proof/src/verifier/cw.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/utils/cw-proof/src/verifier/cw.rs b/utils/cw-proof/src/verifier/cw.rs index c8b3f79..928eaf6 100644 --- a/utils/cw-proof/src/verifier/cw.rs +++ b/utils/cw-proof/src/verifier/cw.rs @@ -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) } }