Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use alloy-chains is_ethereum #11049

Merged
merged 2 commits into from
Sep 19, 2024
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
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
Loading