Skip to content

Commit

Permalink
Merge branch 'main' into tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
jfldde authored Oct 8, 2024
2 parents bb01f33 + eaa8d97 commit 0051bf4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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"
tracing = { version = "0.1.40", default-features = false }

# Citrea dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<C: Config> Node<C> {
}

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

let kind = C::node_kind();
Expand Down
10 changes: 6 additions & 4 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use std::{
path::{Path, PathBuf},
};

use anyhow::anyhow;
use rand::{distributions::Alphanumeric, thread_rng, Rng};
use tracing::debug;
use which::which;

use super::Result;

Expand All @@ -27,9 +27,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<PathBuf> {
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 {
Expand Down

0 comments on commit 0051bf4

Please sign in to comment.