Skip to content

Commit 71e35a7

Browse files
authored
fix(derive-alloy): test coverage (#785)
1 parent 18d28f1 commit 71e35a7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ ignore:
2323
- "**/test_utils*"
2424
- "**/test_util*"
2525
- "**/tests*"
26+
- "crates/derive-alloy/src/alloy_providers.rs"
27+
- "crates/derive-alloy/src/beacon_client.rs"
2628
- "crates/mpt/src/noop.rs"
2729

2830
# Make comments less noisy

crates/derive-alloy/src/errors.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,27 @@ impl From<AlloyProviderError> for PipelineErrorKind {
3434
}
3535
}
3636
}
37+
38+
#[cfg(test)]
39+
mod tests {
40+
use super::*;
41+
42+
#[test]
43+
fn test_from_alloy_provider_error() {
44+
let err: PipelineErrorKind = AlloyProviderError::Rlp(alloy_rlp::Error::Overflow).into();
45+
assert!(matches!(err, PipelineErrorKind::Critical(_)));
46+
47+
let err: PipelineErrorKind =
48+
AlloyProviderError::BlockInfo(FromBlockError::InvalidGenesisHash).into();
49+
assert!(matches!(err, PipelineErrorKind::Critical(_)));
50+
51+
let err: PipelineErrorKind = AlloyProviderError::OpBlockConversion(
52+
OpBlockConversionError::MissingSystemConfigGenesis,
53+
)
54+
.into();
55+
assert!(matches!(err, PipelineErrorKind::Critical(_)));
56+
57+
let err: PipelineErrorKind = AlloyProviderError::Rpc(RpcError::NullResp).into();
58+
assert!(matches!(err, PipelineErrorKind::Temporary(_)));
59+
}
60+
}

0 commit comments

Comments
 (0)