Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Nov 25, 2024
1 parent b7b46ed commit c82994f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
13 changes: 0 additions & 13 deletions crates/genesis/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,6 @@ pub struct HardForkConfiguration {
pub holocene_time: Option<u64>,
}

impl From<&RollupConfig> for HardForkConfiguration {
fn from(config: &RollupConfig) -> Self {
Self {
canyon_time: config.canyon_time,
delta_time: config.delta_time,
ecotone_time: config.ecotone_time,
fjord_time: config.fjord_time,
granite_time: config.granite_time,
holocene_time: config.holocene_time,
}
}
}

/// Defines core blockchain settings per block.
///
/// Tailors unique settings for each network based on
Expand Down
14 changes: 13 additions & 1 deletion crates/genesis/src/rollup.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Rollup Config Types

use crate::{base_fee_params, ChainGenesis};
use crate::{base_fee_params, ChainGenesis, HardForkConfiguration};
use alloy_eips::eip1559::BaseFeeParams;
use alloy_primitives::Address;

Expand Down Expand Up @@ -263,6 +263,18 @@ impl RollupConfig {
}
}

/// Returns the [HardForkConfiguration] using [RollupConfig] timestamps.
pub const fn hardfork_config(&self) -> HardForkConfiguration {
HardForkConfiguration {
canyon_time: self.canyon_time,
delta_time: self.delta_time,
ecotone_time: self.ecotone_time,
fjord_time: self.fjord_time,
granite_time: self.granite_time,
holocene_time: self.holocene_time,
}
}

/// Checks the scalar value in Ecotone.
pub fn check_ecotone_l1_system_config_scalar(scalar: [u8; 32]) -> Result<(), &'static str> {
let version_byte = scalar[0];
Expand Down
2 changes: 1 addition & 1 deletion crates/registry/src/superchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mod tests {
batch_inbox_addr: address!("ff00000000000000000000000000000000008453"),
superchain: String::from("mainnet"),
chain: String::new(),
hardfork_configuration: (&crate::configs::BASE_MAINNET_CONFIG).into(),
hardfork_configuration: crate::configs::BASE_MAINNET_CONFIG.hardfork_config(),
block_time: 2,
seq_window_size: 3600,
max_sequencer_drift: 600,
Expand Down

0 comments on commit c82994f

Please sign in to comment.