Move StartingBalances into protocol module

pull/147/head
Daniel Karzel 3 years ago
parent 41e335fc2d
commit 37f619dbfc

@ -56,12 +56,6 @@ pub struct SwapAmounts {
pub xmr: monero::Amount,
}
#[derive(Debug, Clone)]
pub struct StartingBalances {
pub xmr: monero::Amount,
pub btc: bitcoin::Amount,
}
// TODO: Display in XMR and BTC (not picos and sats).
impl Display for SwapAmounts {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

@ -23,9 +23,9 @@ use swap::{
config::Config,
database::Database,
monero,
protocol::{alice, bob, bob::SwapFactory},
protocol::{alice, bob, bob::SwapFactory, StartingBalances},
trace::init_tracing,
StartingBalances, SwapAmounts,
SwapAmounts,
};
use tracing::{info, log::LevelFilter};
use uuid::Uuid;

@ -1,2 +1,8 @@
pub mod alice;
pub mod bob;
#[derive(Debug, Clone)]
pub struct StartingBalances {
pub xmr: crate::monero::Amount,
pub btc: bitcoin::Amount,
}

@ -12,7 +12,7 @@ use crate::{
Seed as NetworkSeed,
},
protocol::bob,
StartingBalances, SwapAmounts,
SwapAmounts,
};
pub use self::{
@ -24,7 +24,10 @@ pub use self::{
state::*,
swap::{run, run_until},
};
use crate::{config::Config, database::Database, network::transport::build, seed::Seed};
use crate::{
config::Config, database::Database, network::transport::build, protocol::StartingBalances,
seed::Seed,
};
use libp2p::{core::Multiaddr, identity::Keypair};
use rand::rngs::OsRng;
use std::{path::PathBuf, sync::Arc};

@ -10,7 +10,7 @@ use crate::{
database, monero, network,
network::peer_tracker::{self, PeerTracker},
protocol::{alice, bob},
StartingBalances, SwapAmounts,
SwapAmounts,
};
pub use self::{
@ -23,7 +23,10 @@ pub use self::{
state::*,
swap::{run, run_until},
};
use crate::{config::Config, database::Database, network::transport::build, seed::Seed};
use crate::{
config::Config, database::Database, network::transport::build, protocol::StartingBalances,
seed::Seed,
};
use libp2p::identity::Keypair;
use rand::rngs::OsRng;
use std::{path::PathBuf, sync::Arc};

@ -9,9 +9,9 @@ use swap::{
bitcoin,
config::Config,
monero,
protocol::{alice, alice::AliceState, bob, bob::BobState},
protocol::{alice, alice::AliceState, bob, bob::BobState, StartingBalances},
seed::Seed,
StartingBalances, SwapAmounts,
SwapAmounts,
};
use tempfile::tempdir;
use testcontainers::{clients::Cli, Container};

Loading…
Cancel
Save