Skip to content

Commit 9a25c17

Browse files
committed
Resolve to CITREA_E2E_TEST_BINARY instead of which
1 parent 669d14f commit 9a25c17

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ serde_json = { version = "1.0", default-features = false }
1818
tempfile = "3.8"
1919
tokio = { version = "1.39", features = ["full"] }
2020
toml = "0.8.0"
21-
which = "6.0.1"
2221
jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] }
2322
hex = { version = "0.4.3", default-features = false, features = ["serde"] }
2423

src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<C: Config> Node<C> {
8989
}
9090

9191
fn spawn(config: &C) -> Result<SpawnOutput> {
92-
let citrea = get_citrea_path();
92+
let citrea = get_citrea_path()?;
9393
let dir = config.dir();
9494

9595
let kind = C::node_kind();

src/utils.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use std::{
77
path::{Path, PathBuf},
88
};
99

10+
use anyhow::anyhow;
1011
use rand::{distributions::Alphanumeric, thread_rng, Rng};
11-
use which::which;
1212

1313
use super::Result;
1414

@@ -26,9 +26,11 @@ pub fn get_workspace_root() -> PathBuf {
2626
.to_path_buf()
2727
}
2828

29-
/// Get citrea path from CITREA env or resolves to PATH using which.
30-
pub fn get_citrea_path() -> PathBuf {
31-
std::env::var("CITREA").map_or_else(|_| which("citrea").unwrap(), PathBuf::from)
29+
/// Get citrea path from CITREA_E2E_TEST_BINARY env
30+
pub fn get_citrea_path() -> Result<PathBuf> {
31+
std::env::var("CITREA_E2E_TEST_BINARY")
32+
.map(PathBuf::from)
33+
.map_err(|_| anyhow!("CITREA_E2E_TEST_BINARY is not set. Cannot resolve citrea path"))
3234
}
3335

3436
pub fn get_stdout_path(dir: &Path) -> PathBuf {

0 commit comments

Comments
 (0)