Skip to content

Commit

Permalink
chore: use alloy-chains is_ethereum (#11049)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Sep 19, 2024
1 parent c3d090a commit 9f23443
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ revm-primitives = { version = "9.0.2", features = [
], default-features = false }

# eth
alloy-chains = "0.1.18"
alloy-chains = "0.1.32"
alloy-dyn-abi = "0.8.0"
alloy-primitives = { version = "0.8.0", default-features = false }
alloy-rlp = "0.3.4"
Expand Down
18 changes: 3 additions & 15 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{constants::MAINNET_DEPOSIT_CONTRACT, once_cell_set, EthChainSpec};
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloy_chains::{Chain, ChainKind, NamedChain};
use alloy_chains::{Chain, NamedChain};
use alloy_genesis::Genesis;
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use alloy_trie::EMPTY_ROOT_HASH;
Expand Down Expand Up @@ -235,20 +235,8 @@ impl ChainSpec {

/// Returns `true` if this chain contains Ethereum configuration.
#[inline]
pub const fn is_eth(&self) -> bool {
matches!(
self.chain.kind(),
ChainKind::Named(
NamedChain::Mainnet |
NamedChain::Morden |
NamedChain::Ropsten |
NamedChain::Rinkeby |
NamedChain::Goerli |
NamedChain::Kovan |
NamedChain::Holesky |
NamedChain::Sepolia
)
)
pub const fn is_ethereum(&self) -> bool {
self.chain.is_ethereum()
}

/// Returns `true` if this chain contains Optimism configuration.
Expand Down
2 changes: 1 addition & 1 deletion crates/net/discv5/src/network_stack_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl NetworkStackId {
pub fn id(chain: &ChainSpec) -> Option<&'static [u8]> {
if chain.is_optimism() {
return Some(Self::OPEL)
} else if chain.is_eth() {
} else if chain.is_ethereum() {
return Some(Self::ETH)
}

Expand Down

0 comments on commit 9f23443

Please sign in to comment.