diff --git a/src/chainspec/mod.rs b/src/chainspec/mod.rs index 0d3846218..07b3bd2f9 100644 --- a/src/chainspec/mod.rs +++ b/src/chainspec/mod.rs @@ -72,10 +72,6 @@ impl EthChainSpec for HlChainSpec { fn bootnodes(&self) -> Option> { self.inner.bootnodes() } - - fn is_optimism(&self) -> bool { - false - } } impl Hardforks for HlChainSpec { @@ -102,12 +98,6 @@ impl Hardforks for HlChainSpec { } } -impl From for HlChainSpec { - fn from(value: ChainSpec) -> Self { - Self { inner: value } - } -} - impl EthereumHardforks for HlChainSpec { fn ethereum_fork_activation(&self, fork: EthereumHardfork) -> ForkCondition { self.inner.ethereum_fork_activation(fork) @@ -122,12 +112,6 @@ impl EthExecutorSpec for HlChainSpec { } } -impl From for ChainSpec { - fn from(value: HlChainSpec) -> Self { - value.inner - } -} - impl HlChainSpec { pub const MAINNET_RPC_URL: &str = "https://rpc.hyperliquid.xyz/evm"; pub const TESTNET_RPC_URL: &str = "https://rpc.hyperliquid-testnet.xyz/evm"; diff --git a/src/evm/spec.rs b/src/evm/spec.rs index 8edd9e985..b01bd2c30 100644 --- a/src/evm/spec.rs +++ b/src/evm/spec.rs @@ -1,20 +1,15 @@ use revm::primitives::hardfork::SpecId; -use std::str::FromStr; #[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, // V1 + V1, } impl HlSpecId { - pub const fn is_enabled_in(self, other: HlSpecId) -> bool { - other as u8 <= self as u8 - } - - /// Converts the [`HlSpecId`] into a [`SpecId`]. pub const fn into_eth_spec(self) -> SpecId { match self { Self::V1 => SpecId::CANCUN, @@ -23,31 +18,8 @@ impl HlSpecId { } impl From for SpecId { + /// Converts the [`HlSpecId`] into a [`SpecId`]. fn from(spec: HlSpecId) -> Self { spec.into_eth_spec() } } - -/// String identifiers for HL hardforks -pub mod name { - pub const V1: &str = "V1"; -} - -impl FromStr for HlSpecId { - type Err = String; - - fn from_str(s: &str) -> Result { - Ok(match s { - name::V1 => Self::V1, - _ => return Err(format!("Unknown HL spec: {s}")), - }) - } -} - -impl From for &'static str { - fn from(spec_id: HlSpecId) -> Self { - match spec_id { - HlSpecId::V1 => name::V1, - } - } -}