mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-16 10:11:11 -04:00
Fix import format
This commit is contained in:
parent
ae94b170fd
commit
0fe5131a8a
1 changed files with 21 additions and 23 deletions
|
@ -1,27 +1,5 @@
|
||||||
//! Run an XMR/BTC swap in the role of Alice.
|
//! Run an XMR/BTC swap in the role of Alice.
|
||||||
//! Alice holds XMR and wishes receive BTC.
|
//! 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 self::{amounts::*, message0::*, message1::*, message2::*, message3::*};
|
||||||
use crate::{
|
use crate::{
|
||||||
bitcoin,
|
bitcoin,
|
||||||
|
@ -38,7 +16,21 @@ use crate::{
|
||||||
storage::Database,
|
storage::Database,
|
||||||
SwapAmounts, PUNISH_TIMELOCK, REFUND_TIMELOCK,
|
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::{
|
use xmr_btc::{
|
||||||
alice::{self, action_generator, Action, ReceiveBitcoinRedeemEncsig, State0},
|
alice::{self, action_generator, Action, ReceiveBitcoinRedeemEncsig, State0},
|
||||||
bitcoin::BroadcastSignedTransaction,
|
bitcoin::BroadcastSignedTransaction,
|
||||||
|
@ -46,6 +38,12 @@ use xmr_btc::{
|
||||||
monero::{CreateWalletForOutput, Transfer},
|
monero::{CreateWalletForOutput, Transfer},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod amounts;
|
||||||
|
mod message0;
|
||||||
|
mod message1;
|
||||||
|
mod message2;
|
||||||
|
mod message3;
|
||||||
|
|
||||||
// The same data structure is used for swap execution and recovery.
|
// The same data structure is used for swap execution and recovery.
|
||||||
// This allows for a seamless transition from a failed swap to recovery.
|
// This allows for a seamless transition from a failed swap to recovery.
|
||||||
pub enum AliceState {
|
pub enum AliceState {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue