Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Feb 12, 2025
1 parent 147caaf commit effe793
Showing 1 changed file with 57 additions and 19 deletions.
76 changes: 57 additions & 19 deletions crates/optimism/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,41 +87,73 @@ mod tests {

#[test]
fn test_bedrock_post_merge_hardforks() {
assert!(OpSpecId::BEDROCK.into_eth_spec().is_enabled_in(SpecId::MERGE));
assert!(!OpSpecId::BEDROCK.into_eth_spec().is_enabled_in(SpecId::SHANGHAI));
assert!(!OpSpecId::BEDROCK.into_eth_spec().is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::BEDROCK.into_eth_spec().is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::BEDROCK
.into_eth_spec()
.is_enabled_in(SpecId::MERGE));
assert!(!OpSpecId::BEDROCK
.into_eth_spec()
.is_enabled_in(SpecId::SHANGHAI));
assert!(!OpSpecId::BEDROCK
.into_eth_spec()
.is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::BEDROCK
.into_eth_spec()
.is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::BEDROCK.is_enabled_in(OpSpecId::BEDROCK));
assert!(!OpSpecId::BEDROCK.is_enabled_in(OpSpecId::REGOLITH));
}

#[test]
fn test_regolith_post_merge_hardforks() {
assert!(OpSpecId::REGOLITH.into_eth_spec().is_enabled_in(SpecId::MERGE));
assert!(!OpSpecId::REGOLITH.into_eth_spec().is_enabled_in(SpecId::SHANGHAI));
assert!(!OpSpecId::REGOLITH.into_eth_spec().is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::REGOLITH.into_eth_spec().is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::REGOLITH
.into_eth_spec()
.is_enabled_in(SpecId::MERGE));
assert!(!OpSpecId::REGOLITH
.into_eth_spec()
.is_enabled_in(SpecId::SHANGHAI));
assert!(!OpSpecId::REGOLITH
.into_eth_spec()
.is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::REGOLITH
.into_eth_spec()
.is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::REGOLITH.is_enabled_in(OpSpecId::BEDROCK));
assert!(OpSpecId::REGOLITH.is_enabled_in(OpSpecId::REGOLITH));
}

#[test]
fn test_canyon_post_merge_hardforks() {
assert!(OpSpecId::CANYON.into_eth_spec().is_enabled_in(SpecId::MERGE));
assert!(OpSpecId::CANYON.into_eth_spec().is_enabled_in(SpecId::SHANGHAI));
assert!(!OpSpecId::CANYON.into_eth_spec().is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::CANYON.into_eth_spec().is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::CANYON
.into_eth_spec()
.is_enabled_in(SpecId::MERGE));
assert!(OpSpecId::CANYON
.into_eth_spec()
.is_enabled_in(SpecId::SHANGHAI));
assert!(!OpSpecId::CANYON
.into_eth_spec()
.is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::CANYON
.into_eth_spec()
.is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::CANYON.is_enabled_in(OpSpecId::BEDROCK));
assert!(OpSpecId::CANYON.is_enabled_in(OpSpecId::REGOLITH));
assert!(OpSpecId::CANYON.is_enabled_in(OpSpecId::CANYON));
}

#[test]
fn test_ecotone_post_merge_hardforks() {
assert!(OpSpecId::ECOTONE.into_eth_spec().is_enabled_in(SpecId::MERGE));
assert!(OpSpecId::ECOTONE.into_eth_spec().is_enabled_in(SpecId::SHANGHAI));
assert!(OpSpecId::ECOTONE.into_eth_spec().is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::ECOTONE.into_eth_spec().is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::ECOTONE
.into_eth_spec()
.is_enabled_in(SpecId::MERGE));
assert!(OpSpecId::ECOTONE
.into_eth_spec()
.is_enabled_in(SpecId::SHANGHAI));
assert!(OpSpecId::ECOTONE
.into_eth_spec()
.is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::ECOTONE
.into_eth_spec()
.is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::ECOTONE.is_enabled_in(OpSpecId::BEDROCK));
assert!(OpSpecId::ECOTONE.is_enabled_in(OpSpecId::REGOLITH));
assert!(OpSpecId::ECOTONE.is_enabled_in(OpSpecId::CANYON));
Expand All @@ -131,9 +163,15 @@ mod tests {
#[test]
fn test_fjord_post_merge_hardforks() {
assert!(OpSpecId::FJORD.into_eth_spec().is_enabled_in(SpecId::MERGE));
assert!(OpSpecId::FJORD.into_eth_spec().is_enabled_in(SpecId::SHANGHAI));
assert!(OpSpecId::FJORD.into_eth_spec().is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::FJORD.into_eth_spec().is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::FJORD
.into_eth_spec()
.is_enabled_in(SpecId::SHANGHAI));
assert!(OpSpecId::FJORD
.into_eth_spec()
.is_enabled_in(SpecId::CANCUN));
assert!(!OpSpecId::FJORD
.into_eth_spec()
.is_enabled_in(SpecId::LATEST));
assert!(OpSpecId::FJORD.is_enabled_in(OpSpecId::BEDROCK));
assert!(OpSpecId::FJORD.is_enabled_in(OpSpecId::REGOLITH));
assert!(OpSpecId::FJORD.is_enabled_in(OpSpecId::CANYON));
Expand Down

0 comments on commit effe793

Please sign in to comment.