Skip to content

Commit

Permalink
feat: add Isthmus spec (#1948)
Browse files Browse the repository at this point in the history
  • Loading branch information
leruaa authored Dec 24, 2024
1 parent 12b0bab commit e30fe19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ impl PrecompileSpecId {
#[cfg(feature = "optimism")]
BEDROCK | REGOLITH | CANYON => Self::BERLIN,
#[cfg(feature = "optimism")]
ECOTONE | FJORD | GRANITE | HOLOCENE => Self::CANCUN,
ECOTONE | FJORD | GRANITE | HOLOCENE | ISTHMUS => Self::CANCUN,
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions crates/primitives/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub enum SpecId {
HOLOCENE = 24,
PRAGUE = 25,
OSAKA = 26,
ISTHMUS = 27,
#[default]
LATEST = u8::MAX,
}
Expand Down Expand Up @@ -126,6 +127,8 @@ impl From<&str> for SpecId {
"Granite" => SpecId::GRANITE,
#[cfg(feature = "optimism")]
"Holocene" => SpecId::HOLOCENE,
#[cfg(feature = "optimism")]
"Isthmus" => SpecId::ISTHMUS,
_ => Self::LATEST,
}
}
Expand Down Expand Up @@ -168,6 +171,8 @@ impl From<SpecId> for &'static str {
SpecId::GRANITE => "Granite",
#[cfg(feature = "optimism")]
SpecId::HOLOCENE => "Holocene",
#[cfg(feature = "optimism")]
SpecId::ISTHMUS => "Isthmus",
SpecId::LATEST => "Latest",
}
}
Expand Down Expand Up @@ -233,6 +238,8 @@ spec!(FJORD, FjordSpec);
spec!(GRANITE, GraniteSpec);
#[cfg(feature = "optimism")]
spec!(HOLOCENE, HoloceneSpec);
#[cfg(feature = "optimism")]
spec!(ISTHMUS, IsthmusSpec);

#[cfg(not(feature = "optimism"))]
#[macro_export]
Expand Down Expand Up @@ -400,6 +407,10 @@ macro_rules! spec_to_generic {
use $crate::HoloceneSpec as SPEC;
$e
}
$crate::SpecId::ISTHMUS => {
use $crate::IsthmusSpec as SPEC;
$e
}
}
}};
}
Expand Down Expand Up @@ -446,6 +457,8 @@ mod tests {
spec_to_generic!(HOLOCENE, assert_eq!(SPEC::SPEC_ID, HOLOCENE));
spec_to_generic!(PRAGUE, assert_eq!(SPEC::SPEC_ID, PRAGUE));
spec_to_generic!(OSAKA, assert_eq!(SPEC::SPEC_ID, OSAKA));
#[cfg(feature = "optimism")]
spec_to_generic!(ISTHMUS, assert_eq!(SPEC::SPEC_ID, ISTHMUS));
spec_to_generic!(LATEST, assert_eq!(SPEC::SPEC_ID, LATEST));
}
}
Expand Down

0 comments on commit e30fe19

Please sign in to comment.