mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Log rate and amounts for Alice when doing execution setup
This commit is contained in:
parent
b20c16df78
commit
519d1a5701
@ -1,7 +1,7 @@
|
||||
use crate::{bitcoin, monero};
|
||||
use anyhow::{anyhow, Result};
|
||||
use rust_decimal::{prelude::ToPrimitive, Decimal};
|
||||
use std::fmt::Debug;
|
||||
use std::fmt::{Debug, Display, Formatter};
|
||||
|
||||
/// Prices at which 1 XMR will be traded, in BTC (XMR/BTC pair)
|
||||
/// The `ask` represents the minimum price in BTC for which we are willing to
|
||||
@ -48,6 +48,12 @@ impl Rate {
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Rate {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.ask)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
@ -127,7 +127,6 @@ impl Behaviour {
|
||||
|
||||
pub fn start_execution_setup(&mut self, bob_peer_id: PeerId, state0: State0) {
|
||||
self.execution_setup.run(bob_peer_id, state0);
|
||||
info!("Start execution setup with {}", bob_peer_id);
|
||||
}
|
||||
|
||||
/// Send Transfer Proof to Bob.
|
||||
|
@ -22,7 +22,7 @@ use libp2p::{
|
||||
use rand::rngs::OsRng;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::{broadcast, mpsc, mpsc::error::SendError};
|
||||
use tracing::{debug, error, trace};
|
||||
use tracing::{debug, error, info, trace};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[allow(missing_debug_implementations)]
|
||||
@ -229,6 +229,11 @@ where
|
||||
)
|
||||
.await?;
|
||||
|
||||
info!(
|
||||
"Starting execution setup to sell {} for {} (rate of {}) with {}",
|
||||
xmr_amount, btc_amount, rate, bob_peer_id
|
||||
);
|
||||
|
||||
self.swarm.start_execution_setup(bob_peer_id, state0);
|
||||
// Continues once the execution setup protocol is done
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user