revm_bytecode/
decode_errors.rs

1use crate::eip7702::Eip7702DecodeError;
2use core::fmt;
3
4/// Bytecode decode errors
5#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7pub enum BytecodeDecodeError {
8    /// EIP-7702 decode error
9    Eip7702(Eip7702DecodeError),
10}
11
12impl From<Eip7702DecodeError> for BytecodeDecodeError {
13    fn from(error: Eip7702DecodeError) -> Self {
14        Self::Eip7702(error)
15    }
16}
17
18impl core::error::Error for BytecodeDecodeError {}
19
20impl fmt::Display for BytecodeDecodeError {
21    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22        match self {
23            Self::Eip7702(e) => fmt::Display::fmt(e, f),
24        }
25    }
26}