From e3b0080922d4db57533a3cd5c0e277de38a8b6ab Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Tue, 22 Oct 2024 17:43:22 +0400 Subject: [PATCH] error impl --- crates/eip7702/src/error.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/eip7702/src/error.rs b/crates/eip7702/src/error.rs index 381257b..5fca484 100644 --- a/crates/eip7702/src/error.rs +++ b/crates/eip7702/src/error.rs @@ -10,3 +10,13 @@ pub enum Eip7702Error { #[from] Signature(alloy_primitives::SignatureError), } + +#[cfg(feature = "std")] +impl std::error::Error for Eip7702Error { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { + match self { + Self::InvalidSValue(_) => None, + Self::Signature(err) => Some(err), + } + } +}