diff --git a/crates/optimism/src/spec.rs b/crates/optimism/src/spec.rs index a8be1a6690..145596e546 100644 --- a/crates/optimism/src/spec.rs +++ b/crates/optimism/src/spec.rs @@ -86,8 +86,9 @@ pub enum OptimismSpecId { ECOTONE = 21, FJORD = 22, GRANITE = 23, - PRAGUE = 24, - PRAGUE_EOF = 25, + HOLOCENE = 24, + PRAGUE = 25, + PRAGUE_EOF = 26, #[default] LATEST = u8::MAX, } @@ -136,7 +137,8 @@ impl OptimismSpecId { OptimismSpecId::CANCUN | OptimismSpecId::ECOTONE | OptimismSpecId::FJORD - | OptimismSpecId::GRANITE => SpecId::CANCUN, + | OptimismSpecId::GRANITE + | OptimismSpecId::HOLOCENE => SpecId::CANCUN, OptimismSpecId::PRAGUE => SpecId::PRAGUE, OptimismSpecId::PRAGUE_EOF => SpecId::PRAGUE_EOF, OptimismSpecId::LATEST => SpecId::LATEST, @@ -195,6 +197,7 @@ pub mod id { pub const ECOTONE: &str = "Ecotone"; pub const FJORD: &str = "Fjord"; pub const GRANITE: &str = "Granite"; + pub const HOLOCENE: &str = "Holocene"; } impl From<&str> for OptimismSpecId { @@ -260,6 +263,7 @@ impl From for &'static str { OptimismSpecId::ECOTONE => id::ECOTONE, OptimismSpecId::FJORD => id::FJORD, OptimismSpecId::GRANITE => id::GRANITE, + OptimismSpecId::HOLOCENE => id::HOLOCENE, OptimismSpecId::LATEST => id::LATEST, } } @@ -321,6 +325,7 @@ spec!(CANYON, CanyonSpec); spec!(ECOTONE, EcotoneSpec); spec!(FJORD, FjordSpec); spec!(GRANITE, GraniteSpec); +spec!(HOLOCENE, HoloceneSpec); #[macro_export] macro_rules! optimism_spec_to_generic { @@ -413,6 +418,10 @@ macro_rules! optimism_spec_to_generic { use $crate::FjordSpec as SPEC; $e } + $crate::OptimismSpecId::HOLOCENE => { + use $crate::HoloceneSpec as SPEC; + $e + } } }}; } @@ -619,6 +628,10 @@ mod tests { OptimismSpecId::GRANITE, assert_eq!(SPEC::OPTIMISM_SPEC_ID, OptimismSpecId::GRANITE) ); + optimism_spec_to_generic!( + OptimismSpecId::HOLOCENE, + assert_eq!(SPEC::OPTIMISM_SPEC_ID, OptimismSpecId::HOLOCENE) + ); optimism_spec_to_generic!( OptimismSpecId::PRAGUE, assert_eq!(SPEC::OPTIMISM_SPEC_ID, OptimismSpecId::PRAGUE)