refactor: move mdbx::test-utils to reth_db::test-utils and add DatabaseEnvRO (#3466)

This commit is contained in:
joshieDo
2023-06-30 00:52:26 +01:00
committed by GitHub
parent 7850cc0b8d
commit c3ea430e4a
39 changed files with 227 additions and 213 deletions

View File

@ -1,12 +1,12 @@
use reth_db::DatabaseEnv;
#[allow(unused_imports)]
use reth_db::{
database::Database,
mdbx::{test_utils::create_test_db_with_path, EnvKind, WriteMap},
table::*,
test_utils::create_test_rw_db_with_path,
transaction::{DbTx, DbTxMut},
DatabaseEnv,
};
use std::path::Path;
use std::{path::Path, sync::Arc};
/// Path where the DB is initialized for benchmarks.
#[allow(unused)]
@ -60,7 +60,7 @@ where
{
// Reset DB
let _ = std::fs::remove_dir_all(bench_db_path);
let db = create_test_db_with_path::<WriteMap>(EnvKind::RW, bench_db_path);
let db = Arc::try_unwrap(create_test_rw_db_with_path(bench_db_path)).unwrap();
{
// Prepare data to be read