From 472719e4b39f1ada844088481a867d4fa1e4c64f Mon Sep 17 00:00:00 2001 From: grumbach Date: Mon, 20 May 2024 17:28:35 -0400 Subject: [PATCH] fix: dag and dag-svg feature mismatch --- sn_auditor/src/dag_db.rs | 10 +++++----- sn_auditor/src/main.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sn_auditor/src/dag_db.rs b/sn_auditor/src/dag_db.rs index 24eb3cb037..b6f222bad5 100644 --- a/sn_auditor/src/dag_db.rs +++ b/sn_auditor/src/dag_db.rs @@ -8,7 +8,7 @@ use bls::SecretKey; use color_eyre::eyre::{eyre, Result}; -#[cfg(feature = "svg")] +#[cfg(feature = "svg-dag")] use graphviz_rust::{cmd::Format, exec, parse, printer::PrinterContext}; use serde::{Deserialize, Serialize}; use sn_client::networking::NetworkError; @@ -147,7 +147,7 @@ impl SpendDagDb { } /// Dump current DAG as svg to disk - #[cfg(feature = "svg")] + #[cfg(feature = "svg-dag")] pub fn dump_dag_svg(&self) -> Result<()> { info!("Dumping DAG to svg..."); std::fs::create_dir_all(&self.path)?; @@ -189,7 +189,7 @@ impl SpendDagDb { *w_handle = dag; std::mem::drop(w_handle); - #[cfg(feature = "svg")] + #[cfg(feature = "svg-dag")] { // update and save svg to file in a background thread so we don't block // @@ -327,7 +327,7 @@ pub async fn new_dag_with_genesis_only(client: &Client) -> Result { Ok(dag) } -#[cfg(feature = "svg")] +#[cfg(feature = "svg-dag")] fn dag_to_svg(dag: &SpendDag) -> Result> { let dot = dag.dump_dot_format(); let graph = parse(&dot).map_err(|err| eyre!("Failed to parse dag from dot: {err}"))?; @@ -347,7 +347,7 @@ fn dag_to_svg(dag: &SpendDag) -> Result> { // - marks poisoned spends as red // - marks UTXOs and unknown ancestors as yellow // - just pray it works on windows -#[cfg(feature = "svg")] +#[cfg(feature = "svg-dag")] fn quick_edit_svg(svg: Vec, dag: &SpendDag) -> Result> { let mut str = String::from_utf8(svg).map_err(|err| eyre!("Failed svg conversion: {err}"))?; diff --git a/sn_auditor/src/main.rs b/sn_auditor/src/main.rs index 9c19520ab4..ba4ad4a2da 100644 --- a/sn_auditor/src/main.rs +++ b/sn_auditor/src/main.rs @@ -104,7 +104,7 @@ async fn main() -> Result<()> { if let Some(dag_to_view) = opt.offline_viewer { let dag = SpendDagDb::offline(dag_to_view, sk)?; - #[cfg(feature = "svg")] + #[cfg(feature = "svg-dag")] { dag.dump_dag_svg()?; } @@ -211,7 +211,7 @@ async fn initialize_background_spend_dag_collection( } // initialize svg - #[cfg(feature = "svg")] + #[cfg(feature = "svg-dag")] dag.dump_dag_svg()?; // initialize beta rewards program tracking