feat: replace once_cell with std (#11694)

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
Deil Urba
2024-10-15 09:21:01 +01:00
committed by GitHub
parent 2a86245649
commit 3ab1f9559e
19 changed files with 129 additions and 80 deletions

View File

@ -56,13 +56,14 @@ metrics.workspace = true
# misc
auto_impl.workspace = true
itertools.workspace = true
notify = { workspace = true, default-features = false, features = ["macos_fsevent"] }
notify = { workspace = true, default-features = false, features = [
"macos_fsevent",
] }
parking_lot.workspace = true
dashmap = { workspace = true, features = ["inline"] }
strum.workspace = true
# test-utils
once_cell = { workspace = true, optional = true }
reth-ethereum-engine-primitives = { workspace = true, optional = true }
alloy-consensus = { workspace = true, optional = true }
@ -79,20 +80,22 @@ parking_lot.workspace = true
tempfile.workspace = true
assert_matches.workspace = true
rand.workspace = true
once_cell.workspace = true
eyre.workspace = true
alloy-consensus.workspace = true
[features]
optimism = ["reth-primitives/optimism", "reth-execution-types/optimism", "reth-optimism-primitives"]
optimism = [
"reth-primitives/optimism",
"reth-execution-types/optimism",
"reth-optimism-primitives",
]
serde = ["reth-execution-types/serde"]
test-utils = [
"reth-db/test-utils",
"reth-nippy-jar/test-utils",
"reth-trie/test-utils",
"reth-chain-state/test-utils",
"once_cell",
"reth-ethereum-engine-primitives",
"alloy-consensus",
]

View File

@ -5,7 +5,7 @@ use alloy_primitives::{
b256, hex_literal::hex, map::HashMap, Address, BlockNumber, Bytes, Log, Parity, Sealable,
TxKind, B256, U256,
};
use once_cell::sync::Lazy;
use reth_db::tables;
use reth_db_api::{database::Database, models::StoredBlockBodyIndices};
use reth_primitives::{
@ -14,7 +14,7 @@ use reth_primitives::{
};
use reth_trie::root::{state_root_unhashed, storage_root_unhashed};
use revm::{db::BundleState, primitives::AccountInfo};
use std::str::FromStr;
use std::{str::FromStr, sync::LazyLock};
/// Assert genesis block
pub fn assert_genesis_block<DB: Database, Spec: Send + Sync>(
@ -61,7 +61,7 @@ pub fn assert_genesis_block<DB: Database, Spec: Send + Sync>(
// StageCheckpoints is not updated in tests
}
pub(crate) static TEST_BLOCK: Lazy<SealedBlock> = Lazy::new(|| SealedBlock {
pub(crate) static TEST_BLOCK: LazyLock<SealedBlock> = LazyLock::new(|| SealedBlock {
header: SealedHeader::new(
Header {
parent_hash: hex!("c86e8cc0310ae7c531c758678ddbfd16fc51c8cef8cec650b032de9869e8b94f")