diff --git a/.github/codecov.yml b/.github/codecov.yml index f76d9ea1b..1d835ab63 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -23,6 +23,8 @@ ignore: - "**/test_utils*" - "**/test_util*" - "**/tests*" + - "crates/derive-alloy/src/alloy_providers.rs" + - "crates/derive-alloy/src/beacon_client.rs" - "crates/mpt/src/noop.rs" # Make comments less noisy diff --git a/crates/derive-alloy/src/errors.rs b/crates/derive-alloy/src/errors.rs index 5c433c776..8ede5b1c0 100644 --- a/crates/derive-alloy/src/errors.rs +++ b/crates/derive-alloy/src/errors.rs @@ -34,3 +34,27 @@ impl From for PipelineErrorKind { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_from_alloy_provider_error() { + let err: PipelineErrorKind = AlloyProviderError::Rlp(alloy_rlp::Error::Overflow).into(); + assert!(matches!(err, PipelineErrorKind::Critical(_))); + + let err: PipelineErrorKind = + AlloyProviderError::BlockInfo(FromBlockError::InvalidGenesisHash).into(); + assert!(matches!(err, PipelineErrorKind::Critical(_))); + + let err: PipelineErrorKind = AlloyProviderError::OpBlockConversion( + OpBlockConversionError::MissingSystemConfigGenesis, + ) + .into(); + assert!(matches!(err, PipelineErrorKind::Critical(_))); + + let err: PipelineErrorKind = AlloyProviderError::Rpc(RpcError::NullResp).into(); + assert!(matches!(err, PipelineErrorKind::Temporary(_))); + } +}