From ab9f97bb451a0319d9a39eb1d79a72bf1403999e Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 18 Dec 2024 09:31:33 -0600 Subject: [PATCH] chore: move dev deps --- Cargo.lock | 6 +++--- Cargo.toml | 10 ++++++++++ crates/cli/Cargo.toml | 2 +- crates/cli/src/cli.rs | 7 +++---- crates/core/Cargo.toml | 12 ++++++------ e2e-tests-rust/Cargo.lock | 21 ++++++++++++++++++++- e2e-tests-rust/Cargo.toml | 5 ++--- e2e-tests-rust/tests/lib.rs | 8 ++++---- 8 files changed, 49 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3374b11..b0713d6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,7 +404,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "tempfile", + "tempdir", "tokio", "tower 0.4.13", "tower-http", @@ -1166,9 +1166,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 8c99cd65..5ecabfc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,6 +74,16 @@ tracing-subscriber = { version = "0.3", features = [ "local-time", ] } +######################### +# Test dependencies # +######################### +httptest = "0.15.4" +tempdir = "0.3.7" +maplit = "1.0.2" +zksync-web3-rs = "0.1.1" +ethers = { version = "2.0.4", features = ["rustls"] } +test-case = "3.3.1" + ######################### # Local dependencies # ######################### diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 95d68715..ca38223c 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -36,4 +36,4 @@ tower-http.workspace = true flate2.workspace = true [dev-dependencies] -tempfile = "3" +tempdir.workspace = true diff --git a/crates/cli/src/cli.rs b/crates/cli/src/cli.rs index 8453f09d..a2d7bcd7 100644 --- a/crates/cli/src/cli.rs +++ b/crates/cli/src/cli.rs @@ -621,6 +621,8 @@ mod tests { env, net::{IpAddr, Ipv4Addr}, }; + use serde_json::Value; + use tempdir::TempDir; #[test] fn can_parse_host() { @@ -668,10 +670,7 @@ mod tests { #[tokio::test] async fn test_dump_state() -> anyhow::Result<()> { - use serde_json::Value; - use tempfile::tempdir; - - let temp_dir = tempdir()?; + let temp_dir = TempDir::new("state-test").expect("failed creating temporary dir"); let dump_path = temp_dir.path().join("state.json"); let config = anvil_zksync_config::TestNodeConfig { diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 354d8820..118b6092 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -43,9 +43,9 @@ flate2.workspace = true thiserror.workspace = true [dev-dependencies] -httptest = "0.15.4" -tempdir = "0.3.7" -maplit = "1.0.2" -zksync-web3-rs = "0.1.1" -ethers = { version = "2.0.4", features = ["rustls"] } -test-case = "3.3.1" +maplit.workspace = true +ethers.workspace = true +httptest.workspace = true +tempdir.workspace = true +zksync-web3-rs.workspace = true +test-case.workspace = true diff --git a/e2e-tests-rust/Cargo.lock b/e2e-tests-rust/Cargo.lock index 052eeeb6..8c72ea42 100644 --- a/e2e-tests-rust/Cargo.lock +++ b/e2e-tests-rust/Cargo.lock @@ -903,7 +903,7 @@ dependencies = [ "reqwest 0.12.9", "reqwest-middleware", "serde_json", - "tempfile", + "tempdir", "tokio", "tower 0.5.1", ] @@ -5013,6 +5013,15 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + [[package]] name = "reqwest" version = "0.11.27" @@ -6077,6 +6086,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +dependencies = [ + "rand 0.4.6", + "remove_dir_all", +] + [[package]] name = "tempfile" version = "3.14.0" diff --git a/e2e-tests-rust/Cargo.toml b/e2e-tests-rust/Cargo.toml index 3acbb06c..9f0f5062 100644 --- a/e2e-tests-rust/Cargo.toml +++ b/e2e-tests-rust/Cargo.toml @@ -23,10 +23,9 @@ reqwest-middleware = { version = "0.4", features = ["json"] } serde_json = "1" tower = "0.5" http = "1.1.0" +anvil_zksync_core = { path = "../crates/core" } +tempdir = "0.3.7" [dev-dependencies] -serde_json = "1.0" -anvil_zksync_core = { path = "../crates/core" } -tempfile = "3" [workspace] # ignore higher-level workspace diff --git a/e2e-tests-rust/tests/lib.rs b/e2e-tests-rust/tests/lib.rs index 15ede1ef..764b91b6 100644 --- a/e2e-tests-rust/tests/lib.rs +++ b/e2e-tests-rust/tests/lib.rs @@ -20,8 +20,8 @@ const OTHER_ORIGIN: HeaderValue = HeaderValue::from_static("http://other.origin" const ANY_ORIGIN: HeaderValue = HeaderValue::from_static("*"); use anvil_zksync_core::node::VersionedState; -use std::{ fs, convert::identity, thread::sleep, time::Duration}; -use tempfile::tempdir; +use std::{ fs, convert::identity, thread::sleep, time::Duration }; +use tempdir::TempDir; #[tokio::test] async fn interval_sealing_finalization() -> anyhow::Result<()> { @@ -517,7 +517,7 @@ async fn transactions_have_index() -> anyhow::Result<()> { #[tokio::test] async fn dump_state_on_run() -> anyhow::Result<()> { - let temp_dir = tempdir()?; + let temp_dir = TempDir::new("state-test").expect("failed creating temporary dir"); let dump_path = temp_dir.path().join("state_dump.json"); let dump_path_clone = dump_path.clone(); @@ -569,7 +569,7 @@ async fn dump_state_on_run() -> anyhow::Result<()> { #[tokio::test] async fn dump_state_on_fork() -> anyhow::Result<()> { - let temp_dir = tempdir()?; + let temp_dir = TempDir::new("state-fork-test").expect("failed creating temporary dir"); let dump_path = temp_dir.path().join("state_dump_fork.json"); let dump_path_clone = dump_path.clone();