mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: use tempdir when testing static files (#6962)
This commit is contained in:
@ -83,11 +83,11 @@ impl Case for BlockchainTestCase {
|
||||
.try_for_each(|case| {
|
||||
// Create a new test database and initialize a provider for the test case.
|
||||
let db = create_test_rw_db();
|
||||
let static_files_dir = create_test_static_files_dir();
|
||||
let (_static_files_dir, static_files_dir_path) = create_test_static_files_dir();
|
||||
let provider = ProviderFactory::new(
|
||||
db.as_ref(),
|
||||
Arc::new(case.network.clone().into()),
|
||||
static_files_dir.clone(),
|
||||
static_files_dir_path,
|
||||
)?
|
||||
.provider_rw()
|
||||
.unwrap();
|
||||
@ -169,11 +169,6 @@ impl Case for BlockchainTestCase {
|
||||
|
||||
// Drop the provider without committing to the database.
|
||||
drop(provider);
|
||||
// TODO: replace with `tempdir` usage, so the temp directory is removed
|
||||
// automatically when the variable goes out of scope
|
||||
reth_primitives::fs::remove_dir_all(static_files_dir)
|
||||
.expect("Failed to remove static files directory");
|
||||
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user