mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: move LazyLock and OnlyLock exports to primitives traits (#13682)
This commit is contained in:
@ -26,7 +26,6 @@ alloy-consensus.workspace = true
|
||||
|
||||
# misc
|
||||
auto_impl.workspace = true
|
||||
once_cell.workspace = true
|
||||
serde_json.workspace = true
|
||||
derive_more.workspace = true
|
||||
|
||||
@ -47,7 +46,6 @@ std = [
|
||||
"alloy-trie/std",
|
||||
"reth-primitives-traits/std",
|
||||
"alloy-consensus/std",
|
||||
"once_cell/std",
|
||||
"alloy-rlp/std",
|
||||
"reth-ethereum-forks/std",
|
||||
"derive_more/std",
|
||||
|
||||
@ -11,12 +11,6 @@
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use once_cell as _;
|
||||
#[cfg(not(feature = "std"))]
|
||||
pub(crate) use once_cell::sync::{Lazy as LazyLock, OnceCell as OnceLock};
|
||||
#[cfg(feature = "std")]
|
||||
pub(crate) use std::sync::{LazyLock, OnceLock};
|
||||
|
||||
/// Chain specific constants
|
||||
pub(crate) mod constants;
|
||||
pub use constants::MIN_TRANSACTION_GAS;
|
||||
@ -40,6 +34,8 @@ pub use spec::{
|
||||
DepositContract, ForkBaseFeeParams, DEV, HOLESKY, MAINNET, SEPOLIA,
|
||||
};
|
||||
|
||||
use reth_primitives_traits::sync::OnceLock;
|
||||
|
||||
/// Simple utility to create a thread-safe sync cell with a value set.
|
||||
pub fn once_cell_set<T>(value: T) -> OnceLock<T> {
|
||||
let once = OnceLock::new();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
pub use alloy_eips::eip1559::BaseFeeParams;
|
||||
|
||||
use crate::{constants::MAINNET_DEPOSIT_CONTRACT, once_cell_set, EthChainSpec, LazyLock, OnceLock};
|
||||
use crate::{constants::MAINNET_DEPOSIT_CONTRACT, once_cell_set, EthChainSpec};
|
||||
use alloc::{boxed::Box, collections::BTreeMap, string::String, sync::Arc, vec::Vec};
|
||||
use alloy_chains::{Chain, NamedChain};
|
||||
use alloy_consensus::{
|
||||
@ -28,7 +28,10 @@ use reth_network_peers::{
|
||||
base_nodes, base_testnet_nodes, holesky_nodes, mainnet_nodes, op_nodes, op_testnet_nodes,
|
||||
sepolia_nodes, NodeRecord,
|
||||
};
|
||||
use reth_primitives_traits::SealedHeader;
|
||||
use reth_primitives_traits::{
|
||||
sync::{LazyLock, OnceLock},
|
||||
SealedHeader,
|
||||
};
|
||||
|
||||
/// The Ethereum mainnet spec
|
||||
pub static MAINNET: LazyLock<Arc<ChainSpec>> = LazyLock::new(|| {
|
||||
|
||||
Reference in New Issue
Block a user