Skip to content

Commit

Permalink
fix: Error::source for Eip2718Error (alloy-rs#1361)
Browse files Browse the repository at this point in the history
fix: Error::source for Eip2718Error
  • Loading branch information
klkvr authored and lwedge99 committed Oct 8, 2024
1 parent 6f9b5dd commit 2a3ae1d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/eips/src/eip2718.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ impl From<Eip2718Error> for alloy_rlp::Error {
}

#[cfg(feature = "std")]
impl std::error::Error for Eip2718Error {}
impl std::error::Error for Eip2718Error {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match self {
Self::RlpError(err) => Some(err),
Self::UnexpectedType(_) => None,
}
}
}

/// Decoding trait for [EIP-2718] envelopes. These envelopes wrap a transaction
/// or a receipt with a type flag.
Expand Down

0 comments on commit 2a3ae1d

Please sign in to comment.