Files
nanoreth/src/evm/spec.rs
2025-08-25 10:00:43 -04:00

26 lines
599 B
Rust

use revm::primitives::hardfork::SpecId;
#[repr(u8)]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum HlSpecId {
/// Placeholder for evm cancun fork
#[default]
V1,
}
impl HlSpecId {
pub const fn into_eth_spec(self) -> SpecId {
match self {
Self::V1 => SpecId::CANCUN,
}
}
}
impl From<HlSpecId> for SpecId {
/// Converts the [`HlSpecId`] into a [`SpecId`].
fn from(spec: HlSpecId) -> Self {
spec.into_eth_spec()
}
}