Skip to content

Commit 9f23443

Browse files
authored
chore: use alloy-chains is_ethereum (#11049)
1 parent c3d090a commit 9f23443

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ revm-primitives = { version = "9.0.2", features = [
417417
], default-features = false }
418418

419419
# eth
420-
alloy-chains = "0.1.18"
420+
alloy-chains = "0.1.32"
421421
alloy-dyn-abi = "0.8.0"
422422
alloy-primitives = { version = "0.8.0", default-features = false }
423423
alloy-rlp = "0.3.4"

crates/chainspec/src/spec.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{constants::MAINNET_DEPOSIT_CONTRACT, once_cell_set, EthChainSpec};
22
use alloc::{boxed::Box, sync::Arc, vec::Vec};
3-
use alloy_chains::{Chain, ChainKind, NamedChain};
3+
use alloy_chains::{Chain, NamedChain};
44
use alloy_genesis::Genesis;
55
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
66
use alloy_trie::EMPTY_ROOT_HASH;
@@ -235,20 +235,8 @@ impl ChainSpec {
235235

236236
/// Returns `true` if this chain contains Ethereum configuration.
237237
#[inline]
238-
pub const fn is_eth(&self) -> bool {
239-
matches!(
240-
self.chain.kind(),
241-
ChainKind::Named(
242-
NamedChain::Mainnet |
243-
NamedChain::Morden |
244-
NamedChain::Ropsten |
245-
NamedChain::Rinkeby |
246-
NamedChain::Goerli |
247-
NamedChain::Kovan |
248-
NamedChain::Holesky |
249-
NamedChain::Sepolia
250-
)
251-
)
238+
pub const fn is_ethereum(&self) -> bool {
239+
self.chain.is_ethereum()
252240
}
253241

254242
/// Returns `true` if this chain contains Optimism configuration.

crates/net/discv5/src/network_stack_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl NetworkStackId {
2525
pub fn id(chain: &ChainSpec) -> Option<&'static [u8]> {
2626
if chain.is_optimism() {
2727
return Some(Self::OPEL)
28-
} else if chain.is_eth() {
28+
} else if chain.is_ethereum() {
2929
return Some(Self::ETH)
3030
}
3131

0 commit comments

Comments
 (0)