From a9dc012808653d2afd53dd2053d347c735158e40 Mon Sep 17 00:00:00 2001 From: parazyd Date: Fri, 17 Sep 2021 09:36:11 +0200 Subject: [PATCH] [REBASEME] Revert "bin/darkfid2: Move configuration to bin file." This reverts commit 5290cc2fbc291bae16fe6f7718a8614073563650. --- src/bin/darkfid2.rs | 30 +----------------------------- src/cli/cli_config.rs | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/bin/darkfid2.rs b/src/bin/darkfid2.rs index 615bb3890..2bb534624 100644 --- a/src/bin/darkfid2.rs +++ b/src/bin/darkfid2.rs @@ -3,7 +3,6 @@ use log::*; use std::path::PathBuf; use clap::clap_app; -use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; use simplelog::{ CombinedLogger, Config as SimLogConfig, ConfigBuilder, LevelFilter, TermLogger, TerminalMode, @@ -13,7 +12,7 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpListener; use drk::{ - cli::Config, + cli::{Config, DarkfidConfig}, rpc::{ jsonrpc, jsonrpc::{JsonRequest, JsonResult}, @@ -24,33 +23,6 @@ use drk::{ Error, }; -#[derive(Clone, Serialize, Deserialize, Debug)] -struct DarkfidConfig { - #[serde(rename = "connect_url")] - connect_url: String, - - #[serde(rename = "subscriber_url")] - subscriber_url: String, - - #[serde(rename = "cashier_url")] - cashier_url: String, - - #[serde(rename = "rpc_url")] - rpc_url: String, - - #[serde(rename = "database_path")] - database_path: String, - - #[serde(rename = "walletdb_path")] - walletdb_path: String, - - #[serde(rename = "log_path")] - log_path: String, - - #[serde(rename = "password")] - password: String, -} - #[derive(Clone)] struct Darkfid { verbose: bool, diff --git a/src/cli/cli_config.rs b/src/cli/cli_config.rs index 293e1a2d3..c49167ec5 100644 --- a/src/cli/cli_config.rs +++ b/src/cli/cli_config.rs @@ -34,6 +34,33 @@ pub struct DrkConfig { pub log_path: String, } +#[derive(Clone, Serialize, Deserialize, Debug)] +pub struct DarkfidConfig { + #[serde(rename = "connect_url")] + pub connect_url: String, + + #[serde(rename = "subscriber_url")] + pub subscriber_url: String, + + #[serde(rename = "cashier_url")] + pub cashier_url: String, + + #[serde(rename = "rpc_url")] + pub rpc_url: String, + + #[serde(rename = "database_path")] + pub database_path: String, + + #[serde(rename = "walletdb_path")] + pub walletdb_path: String, + + #[serde(rename = "log_path")] + pub log_path: String, + + #[serde(rename = "password")] + pub password: String, +} + #[derive(Serialize, Deserialize, Debug)] pub struct GatewaydConfig { #[serde(rename = "connect_url")]