mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: replace once_cell Lazy with LazyLock (#9844)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a206eb3690
commit
106a0c7cf7
@ -1,4 +1,3 @@
|
||||
use once_cell::sync::Lazy;
|
||||
use reth_chainspec::{Chain, ChainSpec, HOLESKY, MAINNET};
|
||||
use reth_db_api::database::Database;
|
||||
use reth_primitives::{
|
||||
@ -11,7 +10,10 @@ use reth_storage_errors::provider::ProviderResult;
|
||||
use reth_trie::{proof::Proof, Nibbles, StateRoot};
|
||||
use reth_trie_common::{AccountProof, StorageProof};
|
||||
use reth_trie_db::{DatabaseProof, DatabaseStateRoot};
|
||||
use std::{str::FromStr, sync::Arc};
|
||||
use std::{
|
||||
str::FromStr,
|
||||
sync::{Arc, LazyLock},
|
||||
};
|
||||
|
||||
/*
|
||||
World State (sampled from <https://ethereum.stackexchange.com/questions/268/ethereum-block-architecture/6413#6413>)
|
||||
@ -24,7 +26,7 @@ use std::{str::FromStr, sync::Arc};
|
||||
|
||||
All expected testspec results were obtained from querying proof RPC on the running geth instance `geth init crates/trie/testdata/proof-genesis.json && geth --http`.
|
||||
*/
|
||||
static TEST_SPEC: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
|
||||
static TEST_SPEC: LazyLock<Arc<ChainSpec>> = LazyLock::new(|| {
|
||||
ChainSpec {
|
||||
chain: Chain::from_id(12345),
|
||||
genesis: serde_json::from_str(include_str!("../../trie/testdata/proof-genesis.json"))
|
||||
|
||||
Reference in New Issue
Block a user