Revert "feat: Introduce NodeBuilder" (#5868)

This commit is contained in:
Matthias Seitz
2023-12-27 14:23:32 +01:00
committed by GitHub
parent ff78d1e1f9
commit 3aa718a561
12 changed files with 847 additions and 1618 deletions

View File

@ -226,15 +226,9 @@ pub mod test_utils {
}
}
/// Get a temporary directory path to use for the database
pub fn tempdir_path() -> PathBuf {
let builder = tempfile::Builder::new().prefix("reth-test-").rand_bytes(8).tempdir();
builder.expect(ERROR_TEMPDIR).into_path()
}
/// Create read/write database for testing
pub fn create_test_rw_db() -> Arc<TempDatabase<DatabaseEnv>> {
let path = tempdir_path();
let path = tempfile::TempDir::new().expect(ERROR_TEMPDIR).into_path();
let emsg = format!("{}: {:?}", ERROR_DB_CREATION, path);
let db = init_db(&path, None).expect(&emsg);
@ -251,7 +245,7 @@ pub mod test_utils {
/// Create read only database for testing
pub fn create_test_ro_db() -> Arc<TempDatabase<DatabaseEnv>> {
let path = tempdir_path();
let path = tempfile::TempDir::new().expect(ERROR_TEMPDIR).into_path();
{
init_db(path.as_path(), None).expect(ERROR_DB_CREATION);
}