From b77135632c32fa108efb92cb32d84bfc75daa540 Mon Sep 17 00:00:00 2001 From: Gustavo Inacio Date: Wed, 23 Oct 2024 16:37:34 +0200 Subject: [PATCH] style: make it more rusty Signed-off-by: Gustavo Inacio --- crates/header-accumulator/src/era_validator.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/header-accumulator/src/era_validator.rs b/crates/header-accumulator/src/era_validator.rs index 3b61ddcc..e4aa385d 100644 --- a/crates/header-accumulator/src/era_validator.rs +++ b/crates/header-accumulator/src/era_validator.rs @@ -55,15 +55,15 @@ impl EraValidator { let root = epoch_accumulator.tree_hash_root(); let valid_root = self.historical_epochs[epoch.number()]; - if root != valid_root { + if root == valid_root { + Ok(root) + } else { log::error!( "the valid hash is: {:?} and the provided hash was: {:?}", valid_root, root ); - Err(EraValidateError::EraAccumulatorMismatch)?; + Err(EraValidateError::EraAccumulatorMismatch) } - - Ok(root) } }