alloy_eip7702/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use alloy_primitives::U256;

/// EIP-7702 error.
#[derive(Debug, derive_more::Display, derive_more::From)]
pub enum Eip7702Error {
    /// Invalid signature `s` value.
    #[display("invalid signature `s` value: {_0}")]
    InvalidSValue(U256),
    /// Signature error.
    #[from]
    Signature(alloy_primitives::SignatureError),
}

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