From 0fe5131a8a0233f7fd361000ce9c4ef71830e2c2 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 17 Nov 2020 10:06:45 +1100 Subject: [PATCH] Fix import format --- swap/src/alice.rs | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/swap/src/alice.rs b/swap/src/alice.rs index c5aaa159..4803534c 100644 --- a/swap/src/alice.rs +++ b/swap/src/alice.rs @@ -1,27 +1,5 @@ //! Run an XMR/BTC swap in the role of Alice. //! Alice holds XMR and wishes receive BTC. -use anyhow::Result; -use async_recursion::async_recursion; -use async_trait::async_trait; -use backoff::{backoff::Constant as ConstantBackoff, future::FutureOperation as _}; -use genawaiter::GeneratorState; -use libp2p::{ - core::{identity::Keypair, Multiaddr}, - request_response::ResponseChannel, - NetworkBehaviour, PeerId, -}; -use rand::rngs::OsRng; -use std::{sync::Arc, time::Duration}; -use tokio::sync::Mutex; -use tracing::{debug, info, warn}; -use uuid::Uuid; - -mod amounts; -mod message0; -mod message1; -mod message2; -mod message3; - use self::{amounts::*, message0::*, message1::*, message2::*, message3::*}; use crate::{ bitcoin, @@ -38,7 +16,21 @@ use crate::{ storage::Database, SwapAmounts, PUNISH_TIMELOCK, REFUND_TIMELOCK, }; - +use anyhow::Result; +use async_recursion::async_recursion; +use async_trait::async_trait; +use backoff::{backoff::Constant as ConstantBackoff, future::FutureOperation as _}; +use genawaiter::GeneratorState; +use libp2p::{ + core::{identity::Keypair, Multiaddr}, + request_response::ResponseChannel, + NetworkBehaviour, PeerId, +}; +use rand::rngs::OsRng; +use std::{sync::Arc, time::Duration}; +use tokio::sync::Mutex; +use tracing::{debug, info, warn}; +use uuid::Uuid; use xmr_btc::{ alice::{self, action_generator, Action, ReceiveBitcoinRedeemEncsig, State0}, bitcoin::BroadcastSignedTransaction, @@ -46,6 +38,12 @@ use xmr_btc::{ monero::{CreateWalletForOutput, Transfer}, }; +mod amounts; +mod message0; +mod message1; +mod message2; +mod message3; + // The same data structure is used for swap execution and recovery. // This allows for a seamless transition from a failed swap to recovery. pub enum AliceState {