Skip to content

Commit

Permalink
chore: sprinkle a few track_caller (paradigmxyz#13471)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Dec 20, 2024
1 parent 37ef201 commit 378d80a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/storage/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ pub mod test_utils {
}

/// Create `static_files` path for testing
#[track_caller]
pub fn create_test_static_files_dir() -> (TempDir, PathBuf) {
let temp_dir = TempDir::with_prefix("reth-test-static-").expect(ERROR_TEMPDIR);
let path = temp_dir.path().to_path_buf();
Expand All @@ -175,6 +176,7 @@ pub mod test_utils {
}

/// Create read/write database for testing
#[track_caller]
pub fn create_test_rw_db() -> Arc<TempDatabase<DatabaseEnv>> {
let path = tempdir_path();
let emsg = format!("{ERROR_DB_CREATION}: {path:?}");
Expand All @@ -190,6 +192,7 @@ pub mod test_utils {
}

/// Create read/write database for testing
#[track_caller]
pub fn create_test_rw_db_with_path<P: AsRef<Path>>(path: P) -> Arc<TempDatabase<DatabaseEnv>> {
let path = path.as_ref().to_path_buf();
let db = init_db(
Expand All @@ -202,6 +205,7 @@ pub mod test_utils {
}

/// Create read only database for testing
#[track_caller]
pub fn create_test_ro_db() -> Arc<TempDatabase<DatabaseEnv>> {
let args = DatabaseArguments::new(ClientVersion::default())
.with_max_read_transaction_duration(Some(MaxReadTransactionDuration::Unbounded));
Expand Down

0 comments on commit 378d80a

Please sign in to comment.