Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions crates/anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3013,11 +3013,8 @@ pub fn prove_storage(storage: &HashMap<U256, U256>, keys: &[B256]) -> Vec<Vec<By
}

pub fn is_arbitrum(chain_id: u64) -> bool {
matches!(
NamedChain::try_from(chain_id),
Ok(NamedChain::Arbitrum |
NamedChain::ArbitrumTestnet |
NamedChain::ArbitrumGoerli |
NamedChain::ArbitrumNova)
)
if let Ok(chain) = NamedChain::try_from(chain_id) {
return chain.is_arbitrum()
}
false
}
47 changes: 19 additions & 28 deletions crates/cli/src/utils/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,41 +159,32 @@ pub fn init_progress(len: u64, label: &str) -> indicatif::ProgressBar {
/// True if the network calculates gas costs differently.
pub fn has_different_gas_calc(chain_id: u64) -> bool {
if let Some(chain) = Chain::from(chain_id).named() {
return matches!(
chain,
NamedChain::Acala |
NamedChain::AcalaMandalaTestnet |
NamedChain::AcalaTestnet |
NamedChain::Arbitrum |
NamedChain::ArbitrumGoerli |
NamedChain::ArbitrumSepolia |
NamedChain::ArbitrumTestnet |
NamedChain::Etherlink |
NamedChain::EtherlinkTestnet |
NamedChain::Karura |
NamedChain::KaruraTestnet |
NamedChain::Mantle |
NamedChain::MantleSepolia |
NamedChain::MantleTestnet |
NamedChain::Moonbase |
NamedChain::Moonbeam |
NamedChain::MoonbeamDev |
NamedChain::Moonriver
);
return chain.is_arbitrum() ||
matches!(
chain,
NamedChain::Acala |
NamedChain::AcalaMandalaTestnet |
NamedChain::AcalaTestnet |
NamedChain::Etherlink |
NamedChain::EtherlinkTestnet |
NamedChain::Karura |
NamedChain::KaruraTestnet |
NamedChain::Mantle |
NamedChain::MantleSepolia |
NamedChain::MantleTestnet |
NamedChain::Moonbase |
NamedChain::Moonbeam |
NamedChain::MoonbeamDev |
NamedChain::Moonriver
);
}
false
}

/// True if it supports broadcasting in batches.
pub fn has_batch_support(chain_id: u64) -> bool {
if let Some(chain) = Chain::from(chain_id).named() {
return !matches!(
chain,
NamedChain::Arbitrum |
NamedChain::ArbitrumTestnet |
NamedChain::ArbitrumGoerli |
NamedChain::ArbitrumSepolia
);
return !chain.is_arbitrum();
}
true
}
Expand Down