chore(consensus): Add trait object error variant to ConsensusError#492
chore(consensus): Add trait object error variant to ConsensusError#492emhane merged 12 commits intoop-rs:unstablefrom
Conversation
|
asides the smol comments about importing types in import prelude, as you're probably aware the remaining tests using equality of assert_eq!(
result.unwrap_err(),
ConsensusError::BlobGasUsedDiff(GotExpected { got: DA_FOOTPRINT, expected: 0 })
);becomes assert!(
matches!(
result.unwrap_err(),
ConsensusError::BlobGasUsedDiff(GotExpected { got, expected } if got == DA_FOOTPRINT && expected == 0)
)
); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
... and 7 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Hi @emhane should be good this time |
|
we don't want to change the logic, just the syntax. we still need to verify the error data in tests. see how it's done in 246a9c5 |
Thanks! Please have a look again. |
) Close #481 Adds a `Custom` variant to `ConsensusError` that wraps an error trait object, following the same pattern as `DatabaseError` in #388. This enables type-safe error handling between `ConsensusError` and custom L2 error types without matching on error strings. Also removes `PartialEq` and `Eq` derives since `Arc<dyn Error>` can't implement them, and fixes affected tests in downloaders. cc @emhane --------- Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
) Close #481 Adds a `Custom` variant to `ConsensusError` that wraps an error trait object, following the same pattern as `DatabaseError` in #388. This enables type-safe error handling between `ConsensusError` and custom L2 error types without matching on error strings. Also removes `PartialEq` and `Eq` derives since `Arc<dyn Error>` can't implement them, and fixes affected tests in downloaders. cc @emhane --------- Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
) Close #481 Adds a `Custom` variant to `ConsensusError` that wraps an error trait object, following the same pattern as `DatabaseError` in #388. This enables type-safe error handling between `ConsensusError` and custom L2 error types without matching on error strings. Also removes `PartialEq` and `Eq` derives since `Arc<dyn Error>` can't implement them, and fixes affected tests in downloaders. cc @emhane --------- Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Close #481
Adds a
Customvariant toConsensusErrorthat wraps an error trait object, following the same pattern asDatabaseErrorin #388. This enables type-safe error handling betweenConsensusErrorand custom L2 error types without matching on error strings.Also removes
PartialEqandEqderives sinceArc<dyn Error>can't implement them, and fixes affected tests in downloaders.cc @emhane