Skip to content

Commit

Permalink
feat: replace once_cell with std
Browse files Browse the repository at this point in the history
  • Loading branch information
0xurb committed Oct 12, 2024
1 parent 38406cb commit 953785a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ eyre = "0.6.12"
tracing = "0.1.0"
serde = "1"
serde_json = "1"
once_cell = "1.19"
thiserror = "1"

# misc-testing
Expand Down
1 change: 0 additions & 1 deletion crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ categories.workspace = true

[dependencies]
odyssey-precompile.workspace = true
once_cell.workspace = true
reth-cli.workspace = true
reth-node-api.workspace = true
reth-node-builder.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions crates/node/src/chainspec.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Odyssey chainspec parsing logic.
use std::sync::LazyLock;

use alloy_primitives::{b256, U256};
use once_cell::sync::Lazy;
use reth_chainspec::{
once_cell_set, BaseFeeParams, BaseFeeParamsKind, Chain, ChainHardforks, ChainSpec,
EthereumHardfork, ForkCondition, NamedChain,
Expand All @@ -13,7 +13,7 @@ use reth_primitives::constants::ETHEREUM_BLOCK_GAS_LIMIT;
use std::sync::Arc;

/// Odyssey forks.
pub static ODYSSEY_FORKS: Lazy<ChainHardforks> = Lazy::new(|| {
pub static ODYSSEY_FORKS: LazyLock<ChainHardforks> = LazyLock::new(|| {
ChainHardforks::new(vec![
(EthereumHardfork::Frontier.boxed(), ForkCondition::Block(0)),
(EthereumHardfork::Homestead.boxed(), ForkCondition::Block(0)),
Expand Down Expand Up @@ -41,7 +41,7 @@ pub static ODYSSEY_FORKS: Lazy<ChainHardforks> = Lazy::new(|| {
});

/// Odyssey dev testnet specification.
pub static ODYSSEY_DEV: Lazy<Arc<OpChainSpec>> = Lazy::new(|| {
pub static ODYSSEY_DEV: LazyLock<Arc<OpChainSpec>> = LazyLock::new(|| {
OpChainSpec::new(ChainSpec {
chain: Chain::from_named(NamedChain::Odyssey),
genesis: serde_json::from_str(include_str!("../../../etc/dev-genesis.json"))
Expand All @@ -56,7 +56,7 @@ pub static ODYSSEY_DEV: Lazy<Arc<OpChainSpec>> = Lazy::new(|| {
});

/// Odyssey main chain specification.
pub static ODYSSEY_MAINNET: Lazy<Arc<OpChainSpec>> = Lazy::new(|| {
pub static ODYSSEY_MAINNET: LazyLock<Arc<OpChainSpec>> = LazyLock::new(|| {
OpChainSpec::new(ChainSpec {
chain: Chain::from_named(NamedChain::Odyssey),
// genesis contains empty alloc field because state at first bedrock block is imported
Expand Down

0 comments on commit 953785a

Please sign in to comment.