mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: move mdbx::test-utils to reth_db::test-utils and add DatabaseEnvRO (#3466)
This commit is contained in:
@ -11,7 +11,7 @@ use crate::{
|
||||
use backon::{ConstantBuilder, Retryable};
|
||||
use clap::{Parser, Subcommand};
|
||||
use reth_config::Config;
|
||||
use reth_db::mdbx::{Env, EnvKind, WriteMap};
|
||||
use reth_db::open_db;
|
||||
use reth_discv4::NatResolver;
|
||||
use reth_interfaces::p2p::bodies::client::BodiesClient;
|
||||
use reth_primitives::{BlockHashOrNumber, ChainSpec, NodeRecord};
|
||||
@ -101,7 +101,7 @@ impl Command {
|
||||
/// Execute `p2p` command
|
||||
pub async fn execute(&self) -> eyre::Result<()> {
|
||||
let tempdir = tempfile::TempDir::new()?;
|
||||
let noop_db = Arc::new(Env::<WriteMap>::open(&tempdir.into_path(), EnvKind::RW)?);
|
||||
let noop_db = Arc::new(open_db(&tempdir.into_path())?);
|
||||
|
||||
// add network name to data dir
|
||||
let data_dir = self.datadir.unwrap_or_chain_default(self.chain.chain);
|
||||
|
||||
Reference in New Issue
Block a user