mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-07-04 11:17:22 +00:00
remove temp_dir; tempfile has all we need
This commit is contained in:
@@ -26,5 +26,8 @@ serde_json = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -48,3 +48,28 @@ pub async fn solc_version(solc_path: &Path) -> anyhow::Result<semver::Version> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use revive_dt_common::types::VersionOrRequirement;
|
||||
|
||||
#[tokio::test]
|
||||
async fn compiler_version_can_be_obtained() {
|
||||
// Arrange
|
||||
let temp_dir = tempfile::tempdir().expect("can create tempdir");
|
||||
let solc_path = revive_dt_solc_binaries::download_solc(
|
||||
temp_dir.path(),
|
||||
VersionOrRequirement::default(),
|
||||
false,
|
||||
)
|
||||
.await
|
||||
.expect("can download solc");
|
||||
|
||||
// Act
|
||||
let version = solc_version(&solc_path).await;
|
||||
|
||||
// Assert
|
||||
let _ = version.expect("Failed to get version");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ rust-version.workspace = true
|
||||
alloy = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
semver = { workspace = true }
|
||||
temp-dir = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -10,7 +10,7 @@ use alloy::{network::EthereumWallet, signers::local::PrivateKeySigner};
|
||||
use clap::{Parser, ValueEnum};
|
||||
use semver::Version;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use temp_dir::TempDir;
|
||||
use tempfile::TempDir;
|
||||
|
||||
#[derive(Debug, Parser, Clone, Serialize, Deserialize)]
|
||||
#[command(name = "retester")]
|
||||
|
||||
@@ -37,7 +37,6 @@ tracing-subscriber = { workspace = true }
|
||||
semver = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
temp-dir = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -18,7 +18,7 @@ use futures::StreamExt;
|
||||
use futures::stream;
|
||||
use indexmap::IndexMap;
|
||||
use revive_dt_node_interaction::EthereumNode;
|
||||
use temp_dir::TempDir;
|
||||
use tempfile::TempDir;
|
||||
use tokio::{sync::mpsc, try_join};
|
||||
use tracing::{debug, info, info_span, instrument};
|
||||
use tracing_appender::non_blocking::WorkerGuard;
|
||||
|
||||
@@ -27,7 +27,7 @@ sp-core = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
temp-dir = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -605,7 +605,7 @@ impl Drop for GethNode {
|
||||
mod tests {
|
||||
use revive_dt_config::Arguments;
|
||||
|
||||
use temp_dir::TempDir;
|
||||
use tempfile::TempDir;
|
||||
|
||||
use crate::{GENESIS_JSON, Node};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user