Skip to content

Commit

Permalink
Merge of #3337
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 14, 2022
2 parents 4be2883 + 6c8374f commit d74b5e3
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 94 deletions.
84 changes: 20 additions & 64 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ skip-tree = [
# ticket #2984: owo-colors dependencies
{ name = "color-eyre", version = "=0.5.11" },

# tickets #2985 and #2391: tempdir & rand dependencies
{ name = "tempdir", version = "=0.3.7" },

# ticket #2998: hdrhistogram dependencies
{ name = "hdrhistogram", version = "=6.3.4" },

Expand All @@ -61,8 +58,8 @@ skip-tree = [
# ticket #3061: reqwest and minreq dependencies
{ name = "webpki-roots", version = "=0.18.0" },

# ticket #2980: inferno dependency on outdated arrayvec
{ name = "inferno", version = "=0.10.9" },
# ticket #2980: inferno and orchard/cryptographic dependencies
{ name = "orchard", version = "=0.0.0" },

# upgrade orchard from deprecated `bigint` to `uint`: https://github.com/zcash/orchard/issues/219
# alternative: downgrade Zebra to `bigint`
Expand Down
3 changes: 1 addition & 2 deletions zebra-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ regex = "1"
rlimit = "0.5.4"
rocksdb = "0.16.0"
serde = { version = "1", features = ["serde_derive"] }
tempdir = "0.3.7"
tempfile = "3.3.0"
thiserror = "1.0.30"
tokio = { version = "1.15.0", features = ["sync"] }
tower = { version = "0.4.11", features = ["buffer", "util"] }
Expand All @@ -49,7 +49,6 @@ jubjub = "0.8.0"
proptest = "0.10.1"
proptest-derive = "0.3"
spandoc = "0.2"
tempdir = "0.3.7"
tokio = { version = "1.15.0", features = ["full"] }

zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] }
Expand Down
5 changes: 3 additions & 2 deletions zebra-state/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use serde::{Deserialize, Serialize};
use std::{convert::TryInto, path::PathBuf};
use tempdir::TempDir;
use zebra_chain::parameters::Network;

/// Configuration for the state service.
Expand Down Expand Up @@ -46,7 +45,9 @@ pub struct Config {
}

fn gen_temp_path(prefix: &str) -> PathBuf {
TempDir::new(prefix)
tempfile::Builder::new()
.prefix(prefix)
.tempdir()
.expect("temporary directory is created successfully")
.into_path()
}
Expand Down
2 changes: 1 addition & 1 deletion zebra-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ tracing-subscriber = "0.2.25"
tracing-error = "0.1.2"

[dev-dependencies]
tempdir = "0.3.7"
tempfile = "3.3.0"
12 changes: 6 additions & 6 deletions zebra-test/tests/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use std::{process::Command, time::Duration};

use color_eyre::eyre::Result;
use tempdir::TempDir;
use tempfile::tempdir;

use zebra_test::{command::TestDirExt, prelude::Stdio};

Expand Down Expand Up @@ -59,7 +59,7 @@ fn kill_on_timeout_output_continuous_lines() -> Result<()> {

// Without '-v', hexdump hides duplicate lines. But we want duplicate lines
// in this test.
let mut child = TempDir::new("zebra_test")?
let mut child = tempdir()?
.spawn_child_with_command(TEST_CMD, &["-v", "/dev/zero"])?
.with_timeout(Duration::from_secs(2));

Expand All @@ -86,7 +86,7 @@ fn finish_before_timeout_output_single_line() -> Result<()> {
return Ok(());
}

let mut child = TempDir::new("zebra_test")?
let mut child = tempdir()?
.spawn_child_with_command(TEST_CMD, &["zebra_test_output"])?
.with_timeout(Duration::from_secs(2));

Expand Down Expand Up @@ -115,7 +115,7 @@ fn kill_on_timeout_continuous_output_no_newlines() -> Result<()> {
return Ok(());
}

let mut child = TempDir::new("zebra_test")?
let mut child = tempdir()?
.spawn_child_with_command(TEST_CMD, &["/dev/zero"])?
.with_timeout(Duration::from_secs(2));

Expand Down Expand Up @@ -143,7 +143,7 @@ fn finish_before_timeout_short_output_no_newlines() -> Result<()> {
return Ok(());
}

let mut child = TempDir::new("zebra_test")?
let mut child = tempdir()?
.spawn_child_with_command(TEST_CMD, &["zebra_test_output"])?
.with_timeout(Duration::from_secs(2));

Expand Down Expand Up @@ -171,7 +171,7 @@ fn kill_on_timeout_no_output() -> Result<()> {
return Ok(());
}

let mut child = TempDir::new("zebra_test")?
let mut child = tempdir()?
.spawn_child_with_command(TEST_CMD, &["120"])?
.with_timeout(Duration::from_secs(2));

Expand Down
2 changes: 1 addition & 1 deletion zebrad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ abscissa_core = { version = "0.5", features = ["testing"] }
once_cell = "1.9"
regex = "1.4.6"
semver = "1.0.3"
tempdir = "0.3.7"
tempfile = "3.3.0"
tokio = { version = "1.15.0", features = ["full", "test-util"] }

proptest = "0.10"
Expand Down
Loading

0 comments on commit d74b5e3

Please sign in to comment.