Skip to content

Commit aa1f555

Browse files
committed
Remove tempfile as a dependency
See BurntSushi/quickcheck#241 : tempfile depends on an antiquated rand
1 parent ab6e440 commit aa1f555

File tree

39 files changed

+237
-148
lines changed

39 files changed

+237
-148
lines changed

Cargo.lock

+24-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmark/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ protobuf = "~2.7"
1414
rand = "0.7.0"
1515
regex = "1.2.1"
1616
structopt = "0.2.15"
17-
tempdir = "0.3.7"
1817
num_cpus = "1.10.1"
1918

2019
admission_control_proto = { path = "../admission_control/admission_control_proto" }
@@ -30,6 +29,7 @@ metrics = { path = "../common/metrics" }
3029
crypto = { path = "../crypto/crypto" }
3130
proto_conv = { path = "../common/proto_conv" }
3231
rusty-fork = "0.2.1"
32+
tools = { path = "../common/tools" }
3333
types = { path = "../types" }
3434
vm_genesis = { path = "../language/vm/vm_genesis" }
3535

benchmark/src/bin/ruben.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ mod tests {
7070
use libra_swarm::swarm::LibraSwarm;
7171
use rusty_fork::{rusty_fork_id, rusty_fork_test, rusty_fork_test_name};
7272
use std::ops::Range;
73-
use tempdir::TempDir;
73+
use tools::tempdir::TempPath;
7474

7575
/// Start libra_swarm and create a BenchOpt struct for testing.
76-
/// Must return the TempDir otherwise it will be freed somehow.
77-
fn start_swarm_and_setup_arguments() -> (LibraSwarm, BenchOpt, Option<TempDir>) {
76+
/// Must return the TempPath otherwise it will be freed somehow.
77+
fn start_swarm_and_setup_arguments() -> (LibraSwarm, BenchOpt, Option<TempPath>) {
7878
let (faucet_account_keypair, faucet_key_file_path, temp_dir) =
7979
generate_keypair::load_faucet_key_or_create_default(None);
8080
let topology = LibraSwarmTopology::create_validator_network(4);

client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ num-traits = "0.2"
2121
serde = { version = "1.0.96", features = ["derive"] }
2222
serde_json = "1.0.40"
2323
structopt = "0.2.15"
24-
tempfile = "3.1.0"
2524

2625
admission_control_proto = { version = "0.1.0", path = "../admission_control/admission_control_proto" }
2726
config = { path = "../config" }
@@ -33,6 +32,7 @@ logger = { path = "../common/logger" }
3332
metrics = { path = "../common/metrics" }
3433
proto_conv = { path = "../common/proto_conv" }
3534
types = { path = "../types" }
35+
tools = { path = "../common/tools/" }
3636
vm_genesis = { path = "../language/vm/vm_genesis" }
3737

3838
[dev-dependencies]

client/libra_wallet/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ path = "../../common/failure_ext"
3636
package = "failure_ext"
3737

3838
[dev-dependencies]
39-
tempfile = "3.1.0"
4039
types = { path = "../../types", features = ["testing"]}
40+
tools = { path = "../../common/tools"}

client/libra_wallet/src/mnemonic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::{
1919
};
2020

2121
#[cfg(test)]
22-
use tempfile::NamedTempFile;
22+
use tools::tempdir::TempPath;
2323

2424
/// Mnemonic seed for deterministic key derivation based on [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki).
2525
/// The mnemonic must encode entropy in a multiple of 32 bits. With more entropy, security is
@@ -447,8 +447,8 @@ fn test_roundtrip_mnemonic() {
447447
let mut rng = EntropyRng::new();
448448
let mut buf = [0u8; 32];
449449
rng.fill_bytes(&mut buf[..]);
450-
let file = NamedTempFile::new().unwrap();
451-
let path = file.into_temp_path();
450+
let file = TempPath::new();
451+
let path = file.path();
452452
let mnemonic = Mnemonic::mnemonic(&buf[..]).unwrap();
453453
mnemonic.write(&path).unwrap();
454454
let other_mnemonic = Mnemonic::read(&path).unwrap();

0 commit comments

Comments
 (0)