Skip to content

Commit 1870ca7

Browse files
committed
Resolve to CITREA_E2E_TEST_BINARY instead of which
1 parent 629e82f commit 1870ca7

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ bitcoin = { version = "0.32.2", features = ["serde", "rand"] }
1111
bitcoincore-rpc = { version = "0.18.0" }
1212
bollard = { version = "0.17.1" }
1313
futures = "0.3"
14-
hex = { version = "0.4.3", default-features = false, features = ["serde"] }
15-
jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] }
1614
log = "0.4"
1715
rand = "0.8"
1816
serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] }
1917
serde_json = { version = "1.0", default-features = false }
2018
tempfile = "3.8"
2119
tokio = { version = "1.39", features = ["full"] }
2220
toml = "0.8.0"
23-
which = "6.0.1"
21+
jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] }
22+
hex = { version = "0.4.3", default-features = false, features = ["serde"] }
2423

2524
# Citrea dependencies
2625
sov-ledger-rpc = { git = "https://github.com/chainwayxyz/citrea", rev = "82bf52d", default-features = false, features = ["client"] }

src/node.rs

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

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

9797
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)