From 0b1a4d120e7a14669711269df9e38c758c155b5f Mon Sep 17 00:00:00 2001 From: yaziciahmet Date: Tue, 8 Oct 2024 15:43:49 +0200 Subject: [PATCH 1/2] Expose ProverGuestRunConfig --- src/config/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index f515993..2d602e8 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -16,7 +16,7 @@ pub use test_case::{TestCaseConfig, TestCaseEnv}; pub use utils::config_to_file; pub use crate::citrea_config::{ - batch_prover::BatchProverConfig, + batch_prover::{BatchProverConfig, ProverGuestRunConfig}, bitcoin::BitcoinServiceConfig, light_client_prover::LightClientProverConfig, rollup::{FullNodeConfig, RollupPublicKeys, RpcConfig, RunnerConfig, StorageConfig}, From eaa8d97a2817c8ff0b9afb9efc32a58d9deef3b3 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:45:27 +0100 Subject: [PATCH 2/2] Resolve citrea binary path to CITREA_E2E_TEST_BINARY (#15) * Resolve to CITREA_E2E_TEST_BINARY instead of which * Fix toml --- Cargo.toml | 1 - src/node.rs | 2 +- src/utils.rs | 10 ++++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f9557b5..e7b6018 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ serde_json = { version = "1.0", default-features = false } tempfile = "3.8" tokio = { version = "1.39", features = ["full"] } toml = "0.8.0" -which = "6.0.1" # Citrea dependencies sov-ledger-rpc = { git = "https://github.com/chainwayxyz/citrea", rev = "82bf52d", default-features = false, features = ["client"] } diff --git a/src/node.rs b/src/node.rs index b6f5d55..4cb24b0 100644 --- a/src/node.rs +++ b/src/node.rs @@ -91,7 +91,7 @@ impl Node { } fn spawn(config: &C) -> Result { - let citrea = get_citrea_path(); + let citrea = get_citrea_path()?; let dir = config.dir(); let kind = C::node_kind(); diff --git a/src/utils.rs b/src/utils.rs index e05b683..b5f9916 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -7,8 +7,8 @@ use std::{ path::{Path, PathBuf}, }; +use anyhow::anyhow; use rand::{distributions::Alphanumeric, thread_rng, Rng}; -use which::which; use super::Result; @@ -26,9 +26,11 @@ pub fn get_workspace_root() -> PathBuf { .to_path_buf() } -/// Get citrea path from CITREA env or resolves to PATH using which. -pub fn get_citrea_path() -> PathBuf { - std::env::var("CITREA").map_or_else(|_| which("citrea").unwrap(), PathBuf::from) +/// Get citrea path from CITREA_E2E_TEST_BINARY env +pub fn get_citrea_path() -> Result { + std::env::var("CITREA_E2E_TEST_BINARY") + .map(PathBuf::from) + .map_err(|_| anyhow!("CITREA_E2E_TEST_BINARY is not set. Cannot resolve citrea path")) } pub fn get_stdout_path(dir: &Path) -> PathBuf {