diff --git a/swap/src/api.rs b/swap/src/api.rs index 3f161c43..bc7f5385 100644 --- a/swap/src/api.rs +++ b/swap/src/api.rs @@ -26,6 +26,7 @@ pub struct Config { seed: Option, debug: bool, json: bool, + data_dir: PathBuf, pub is_testnet: bool, } @@ -109,6 +110,7 @@ impl Context { debug, json, is_testnet, + data_dir, }, shutdown: Arc::new(shutdown), running_swap: Arc::new(Mutex::new(false)), @@ -238,6 +240,7 @@ pub mod api_test { debug, json, is_testnet, + data_dir } } } diff --git a/swap/src/api/request.rs b/swap/src/api/request.rs index d9e85653..936e9e35 100644 --- a/swap/src/api/request.rs +++ b/swap/src/api/request.rs @@ -226,6 +226,7 @@ impl Request { let state: BobState = state.try_into()?; vec.push((swap_id, state.to_string())); } + json!({ "swaps": vec }) } Method::RawHistory => { @@ -264,17 +265,13 @@ impl Request { }) } Method::Config => { - // tracing::info!(path=%data_dir.display(), "Data directory"); - // tracing::info!(path=%format!("{}/logs", data_dir.display()), - // "Log files directory"); - // tracing::info!(path=%format!("{}/sqlite", data_dir.display()), "Sqlite file - // location"); - // tracing::info!(path=%format!("{}/seed.pem", data_dir.display()), "Seed file - // location"); - // tracing::info!(path=%format!("{}/monero", data_dir.display()), - // "Monero-wallet-rpc directory"); - // tracing::info!(path=%format!("{}/wallet", data_dir.display()), "Internal - // bitcoin wallet directory"); + let data_dir_display = context.config.data_dir.display(); + tracing::info!(path=%data_dir_display, "Data directory"); + tracing::info!(path=%format!("{}/logs", data_dir_display), "Log files directory"); + tracing::info!(path=%format!("{}/sqlite", data_dir_display), "Sqlite file location"); + tracing::info!(path=%format!("{}/seed.pem", data_dir_display), "Seed file location"); + tracing::info!(path=%format!("{}/monero", data_dir_display), "Monero-wallet-rpc directory"); + tracing::info!(path=%format!("{}/wallet", data_dir_display), "Internal bitcoin wallet directory"); json!({ "result": [] diff --git a/swap/src/bin/swap.rs b/swap/src/bin/swap.rs index 29ce0fae..54714495 100644 --- a/swap/src/bin/swap.rs +++ b/swap/src/bin/swap.rs @@ -34,7 +34,6 @@ async fn main() -> Result<()> { eprintln!("{}", e); } let result = request.call(Arc::clone(&context)).await?; - println!("{}", result); Ok(()) }