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