diff --git a/src/headers/error.rs b/src/headers/error.rs index d5153f8..4a7fcf1 100644 --- a/src/headers/error.rs +++ b/src/headers/error.rs @@ -9,8 +9,8 @@ pub enum BlockHeaderError { JsonError(#[from] serde_json::Error), #[error("Invalid input")] InvalidInput, - #[error("Mismatched roots: expected {0:?}, got {1:?}")] - MismatchedRoots(BlockHeaderRoots, BlockHeaderRoots), + #[error("Mismatched roots")] + MismatchedRoots(Box<(BlockHeaderRoots, BlockHeaderRoots)>), #[error("Missing header")] MissingHeader, #[error("Invalid total difficulty")] diff --git a/src/headers/mod.rs b/src/headers/mod.rs index 927c28b..ac90601 100644 --- a/src/headers/mod.rs +++ b/src/headers/mod.rs @@ -39,10 +39,10 @@ pub fn check_valid_header(block: &Block, header_dir: &str) -> Result<(), BlockHe let block_header_roots: BlockHeaderRoots = block_header.clone().try_into()?; // TODO: Errors if header_roots != block_header_roots { - return Err(BlockHeaderError::MismatchedRoots( + return Err(BlockHeaderError::MismatchedRoots(Box::new(( header_roots, block_header_roots, - )); + )))); } Ok(())