alloy_eip7702/
error.rs

1use alloy_primitives::U256;
2
3/// EIP-7702 error.
4#[derive(Debug, derive_more::Display, derive_more::From)]
5pub enum Eip7702Error {
6    /// Invalid signature `s` value.
7    #[display("invalid signature `s` value: {_0}")]
8    InvalidSValue(U256),
9    /// Signature error.
10    #[from]
11    Signature(alloy_primitives::SignatureError),
12}
13
14#[cfg(feature = "std")]
15impl std::error::Error for Eip7702Error {
16    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
17        match self {
18            Self::InvalidSValue(_) => None,
19            Self::Signature(err) => Some(err),
20        }
21    }
22}