From 05cb35569884c12f4f99831a671770d4909b15ce Mon Sep 17 00:00:00 2001 From: rishflab Date: Tue, 12 Jan 2021 10:57:17 +1100 Subject: [PATCH] Fix rebase issues --- swap/src/lib.rs | 0 swap/src/main.rs | 5 ++++- swap/src/tests.rs | 13 ++++--------- swap/src/tests/happy_path.rs | 5 +++-- 4 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 swap/src/lib.rs diff --git a/swap/src/lib.rs b/swap/src/lib.rs deleted file mode 100644 index e69de29b..00000000 diff --git a/swap/src/main.rs b/swap/src/main.rs index a948bc48..c8e23852 100644 --- a/swap/src/main.rs +++ b/swap/src/main.rs @@ -13,6 +13,7 @@ #![forbid(unsafe_code)] #![allow(non_snake_case)] +use crate::seed::Seed; use anyhow::{bail, Context, Result}; use cli::{Command, Options, Resume}; use config::Config; @@ -32,9 +33,11 @@ pub mod bitcoin; pub mod cli; pub mod config; pub mod database; +pub mod fs; pub mod monero; pub mod network; pub mod protocol; +pub mod seed; #[cfg(test)] mod tests; pub mod trace; @@ -57,7 +60,7 @@ async fn main() -> Result<()> { let db = Database::open(data_dir.join("database").as_path()).context("Could not open database")?; - let seed = swap::config::seed::Seed::from_file_or_generate(&data_dir) + let seed = config::seed::Seed::from_file_or_generate(&data_dir) .expect("Could not retrieve/initialize seed") .into(); diff --git a/swap/src/tests.rs b/swap/src/tests.rs index 30580fc4..c1d5eb30 100644 --- a/swap/src/tests.rs +++ b/swap/src/tests.rs @@ -14,8 +14,8 @@ use crate::{ database::Database, monero, network, network::transport::build, - protocol::{alice, alice::AliceState, bob, bob::BobState,seed::Seed, - SwapAmounts}, + protocol::{alice, alice::AliceState, bob, bob::BobState, SwapAmounts}, + seed::Seed, }; mod happy_path; @@ -272,19 +272,14 @@ pub fn init_tracing() -> DefaultGuard { let global_filter = tracing::Level::WARN; let swap_filter = tracing::Level::DEBUG; - let xmr_btc_filter = tracing::Level::DEBUG; let monero_harness_filter = tracing::Level::INFO; let bitcoin_harness_filter = tracing::Level::INFO; use tracing_subscriber::util::SubscriberInitExt as _; tracing_subscriber::fmt() .with_env_filter(format!( - "{},swap={},xmr_btc={},monero_harness={},bitcoin_harness={}", - global_filter, - swap_filter, - xmr_btc_filter, - monero_harness_filter, - bitcoin_harness_filter, + "{}, swap={}, monero_harness={},bitcoin_harness={}", + global_filter, swap_filter, monero_harness_filter, bitcoin_harness_filter, )) .set_default() } diff --git a/swap/src/tests/happy_path.rs b/swap/src/tests/happy_path.rs index 45505e9c..59806346 100644 --- a/swap/src/tests/happy_path.rs +++ b/swap/src/tests/happy_path.rs @@ -14,6 +14,7 @@ use crate::{ monero, protocol::{alice, bob}, seed::Seed, + tests::{init_alice, init_bob, init_containers, init_tracing, Containers}, }; /// Run the following tests with RUST_MIN_STACK=10000000 @@ -25,11 +26,11 @@ async fn happy_path() { let cli = Cli::default(); let ( monero, - tests::Containers { + Containers { bitcoind, monerods: _monerods, }, - ) = tests::init_containers(&cli).await; + ) = init_containers(&cli).await; let btc_to_swap = bitcoin::Amount::from_sat(1_000_000); let btc_alice = bitcoin::Amount::ZERO;