Skip to content

Commit

Permalink
feat: add op and arb mempool ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Vid201 committed Nov 10, 2024
1 parent dc97ad5 commit 3bfb5b9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion crates/primitives/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ impl ChainSpec {
11155111 => Self::sepolia(),
137 => Self::polygon(),
80002 => Self::polygon_amoy(),
42161 => Self::arbitrum(),
421614 => Self::arbitrum_sepolia(),
10 => Self::optimism(),
_ => Self::default(chain_id),
}
}
Expand All @@ -33,7 +35,7 @@ impl ChainSpec {
Self {
chain: Chain::from(NamedChain::Mainnet),
block_time: Duration::from_secs(12),
canonical_mempools: vec![],
canonical_mempools: vec!["QmVEt8BqyX7mbPhMNkmhnxL7fLxcXxsReMQcjYMBSHBfy7".into()],
}
}

Expand Down Expand Up @@ -76,6 +78,15 @@ impl ChainSpec {
}
}

/// 'ChainSpec' for arbitrum
pub fn arbitrum() -> Self {
Self {
chain: Chain::from(NamedChain::Arbitrum),
block_time: Duration::from_millis(250),
canonical_mempools: vec!["QmSpr2Q6cMfZ2CvXecH843KtvnG3tzvxZVy1jKphYKd6tf".into()],
}
}

/// 'ChainSpec' for arbitrum sepolia
pub fn arbitrum_sepolia() -> Self {
Self {
Expand All @@ -85,6 +96,15 @@ impl ChainSpec {
}
}

/// 'ChainSpec' for optimism
pub fn optimism() -> Self {
Self {
chain: Chain::from(NamedChain::Optimism),
block_time: Duration::from_secs(2),
canonical_mempools: vec!["QmPkygym9oarrdiTeGBFQqbJcjpv4yHLLXrqQYGqKiXs7s".into()],
}
}

/// Default 'ChainSpec'
pub fn default(chain_id: u64) -> Self {
Self {
Expand Down

0 comments on commit 3bfb5b9

Please sign in to comment.