Skip to content

Commit

Permalink
feat: handle Isthmus in revm_spec_by_timestamp_after_bedrock() (#13607)
Browse files Browse the repository at this point in the history
  • Loading branch information
leruaa authored Dec 31, 2024
1 parent f163b3d commit c0a8a7b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/optimism/evm/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn revm_spec_by_timestamp_after_bedrock(
timestamp: u64,
) -> revm_primitives::SpecId {
if chain_spec.fork(OpHardfork::Isthmus).active_at_timestamp(timestamp) {
todo!()
revm_primitives::ISTHMUS
} else if chain_spec.fork(OpHardfork::Holocene).active_at_timestamp(timestamp) {
revm_primitives::HOLOCENE
} else if chain_spec.fork(OpHardfork::Granite).active_at_timestamp(timestamp) {
Expand Down Expand Up @@ -50,6 +50,10 @@ mod tests {
let cs = ChainSpecBuilder::mainnet().chain(reth_chainspec::Chain::from_id(10)).into();
f(cs).build()
}
assert_eq!(
revm_spec_by_timestamp_after_bedrock(&op_cs(|cs| cs.isthmus_activated()), 0),
revm_primitives::ISTHMUS
);
assert_eq!(
revm_spec_by_timestamp_after_bedrock(&op_cs(|cs| cs.holocene_activated()), 0),
revm_primitives::HOLOCENE
Expand Down Expand Up @@ -87,6 +91,10 @@ mod tests {
let cs = ChainSpecBuilder::mainnet().chain(reth_chainspec::Chain::from_id(10)).into();
f(cs).build()
}
assert_eq!(
revm_spec(&op_cs(|cs| cs.isthmus_activated()), &Default::default()),
revm_primitives::ISTHMUS
);
assert_eq!(
revm_spec(&op_cs(|cs| cs.holocene_activated()), &Default::default()),
revm_primitives::HOLOCENE
Expand Down

0 comments on commit c0a8a7b

Please sign in to comment.