mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 14:58:31 +00:00
replace tempdir by tempfile (#2143)
## Issue Addressed Fixes #2141 Remove [tempdir](https://docs.rs/tempdir/0.3.7/tempdir/) in favor of [tempfile](https://docs.rs/tempfile/3.1.0/tempfile/). ## Proposed Changes `tempfile` has a slightly different api that makes creating temp folders with a name prefix a chore (`tempdir::TempDir::new("toto")` => `tempfile::Builder::new().prefix("toto").tempdir()`). So I removed temp folder name prefix where I deemed it not useful. Otherwise, the functionality is the same.
This commit is contained in:
@@ -239,7 +239,7 @@ impl Eth2NetworkConfig {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use ssz::Encode;
|
||||
use tempdir::TempDir;
|
||||
use tempfile::Builder as TempBuilder;
|
||||
use types::{Eth1Data, Hash256, MainnetEthSpec, V012LegacyEthSpec, YamlConfig};
|
||||
|
||||
type E = V012LegacyEthSpec;
|
||||
@@ -301,7 +301,10 @@ mod tests {
|
||||
genesis_state: Option<BeaconState<E>>,
|
||||
yaml_config: Option<YamlConfig>,
|
||||
) {
|
||||
let temp_dir = TempDir::new("eth2_testnet_test").expect("should create temp dir");
|
||||
let temp_dir = TempBuilder::new()
|
||||
.prefix("eth2_testnet_test")
|
||||
.tempdir()
|
||||
.expect("should create temp dir");
|
||||
let base_dir = temp_dir.path().join("my_testnet");
|
||||
let deposit_contract_deploy_block = 42;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user