diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index 61e5ed8df510..4c335df222d2 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -64,20 +64,6 @@ impl ProviderFactory { Self { db, chain_spec, snapshot_provider: None } } - /// Create new database provider by passing a path. [`ProviderFactory`] will own the database - /// instance. - pub fn new_with_database_path>( - path: P, - chain_spec: Arc, - args: DatabaseArguments, - ) -> RethResult> { - Ok(ProviderFactory:: { - db: init_db(path, args).map_err(|e| RethError::Custom(e.to_string()))?, - chain_spec, - snapshot_provider: None, - }) - } - /// Database provider that comes with a shared snapshot provider. pub fn with_snapshots( mut self, @@ -97,6 +83,22 @@ impl ProviderFactory { } } +impl ProviderFactory { + /// Create new database provider by passing a path. [`ProviderFactory`] will own the database + /// instance. + pub fn new_with_database_path>( + path: P, + chain_spec: Arc, + args: DatabaseArguments, + ) -> RethResult { + Ok(ProviderFactory:: { + db: init_db(path, args).map_err(|e| RethError::Custom(e.to_string()))?, + chain_spec, + snapshot_provider: None, + }) + } +} + impl ProviderFactory { /// Returns a provider with a created `DbTx` inside, which allows fetching data from the /// database using different types of providers. Example: [`HeaderProvider`] @@ -534,7 +536,7 @@ mod tests { use alloy_rlp::Decodable; use assert_matches::assert_matches; use rand::Rng; - use reth_db::{tables, test_utils::ERROR_TEMPDIR, transaction::DbTxMut, DatabaseEnv}; + use reth_db::{tables, test_utils::ERROR_TEMPDIR, transaction::DbTxMut}; use reth_interfaces::{ provider::ProviderError, test_utils::{ @@ -578,7 +580,7 @@ mod tests { #[test] fn provider_factory_with_database_path() { let chain_spec = ChainSpecBuilder::mainnet().build(); - let factory = ProviderFactory::::new_with_database_path( + let factory = ProviderFactory::new_with_database_path( tempfile::TempDir::new().expect(ERROR_TEMPDIR).into_path(), Arc::new(chain_spec), Default::default(),