fix: add data_dir to config to make config command work

This commit is contained in:
Lorenzo Tucci 2023-01-24 20:54:37 +01:00
parent 250764ed30
commit dc8982731c
No known key found for this signature in database
GPG key ID: D98C4FA2CDF590A0
3 changed files with 11 additions and 12 deletions

View file

@ -26,6 +26,7 @@ pub struct Config {
seed: Option<Seed>, seed: Option<Seed>,
debug: bool, debug: bool,
json: bool, json: bool,
data_dir: PathBuf,
pub is_testnet: bool, pub is_testnet: bool,
} }
@ -109,6 +110,7 @@ impl Context {
debug, debug,
json, json,
is_testnet, is_testnet,
data_dir,
}, },
shutdown: Arc::new(shutdown), shutdown: Arc::new(shutdown),
running_swap: Arc::new(Mutex::new(false)), running_swap: Arc::new(Mutex::new(false)),
@ -238,6 +240,7 @@ pub mod api_test {
debug, debug,
json, json,
is_testnet, is_testnet,
data_dir
} }
} }
} }

View file

@ -226,6 +226,7 @@ impl Request {
let state: BobState = state.try_into()?; let state: BobState = state.try_into()?;
vec.push((swap_id, state.to_string())); vec.push((swap_id, state.to_string()));
} }
json!({ "swaps": vec }) json!({ "swaps": vec })
} }
Method::RawHistory => { Method::RawHistory => {
@ -264,17 +265,13 @@ impl Request {
}) })
} }
Method::Config => { Method::Config => {
// tracing::info!(path=%data_dir.display(), "Data directory"); let data_dir_display = context.config.data_dir.display();
// tracing::info!(path=%format!("{}/logs", data_dir.display()), tracing::info!(path=%data_dir_display, "Data directory");
// "Log files directory"); tracing::info!(path=%format!("{}/logs", data_dir_display), "Log files directory");
// tracing::info!(path=%format!("{}/sqlite", data_dir.display()), "Sqlite file tracing::info!(path=%format!("{}/sqlite", data_dir_display), "Sqlite file location");
// location"); tracing::info!(path=%format!("{}/seed.pem", data_dir_display), "Seed file location");
// tracing::info!(path=%format!("{}/seed.pem", data_dir.display()), "Seed file tracing::info!(path=%format!("{}/monero", data_dir_display), "Monero-wallet-rpc directory");
// location"); tracing::info!(path=%format!("{}/wallet", data_dir_display), "Internal bitcoin wallet directory");
// 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!({ json!({
"result": [] "result": []

View file

@ -34,7 +34,6 @@ async fn main() -> Result<()> {
eprintln!("{}", e); eprintln!("{}", e);
} }
let result = request.call(Arc::clone(&context)).await?; let result = request.call(Arc::clone(&context)).await?;
println!("{}", result);
Ok(()) Ok(())
} }