mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
26 lines
599 B
Rust
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()
|
|
}
|
|
}
|