diff --git a/xmr-btc/Cargo.toml b/xmr-btc/Cargo.toml index 65ce3ae5..c3b4c0ea 100644 --- a/xmr-btc/Cargo.toml +++ b/xmr-btc/Cargo.toml @@ -17,7 +17,6 @@ monero = "0.9" rand = "0.7" sha2 = "0.9" thiserror = "1" -tokio = { version = "0.2", default-features = false, features = ["time"] } tracing = "0.1" [dev-dependencies] diff --git a/xmr-btc/src/alice.rs b/xmr-btc/src/alice.rs index 07ed68e0..4bbb04aa 100644 --- a/xmr-btc/src/alice.rs +++ b/xmr-btc/src/alice.rs @@ -76,7 +76,7 @@ pub async fn next_state< } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub enum State { State0(State0), State1(State1), @@ -172,7 +172,7 @@ impl State { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State0 { a: bitcoin::SecretKey, s_a: cross_curve_dleq::Scalar, @@ -258,7 +258,7 @@ impl State0 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State1 { a: bitcoin::SecretKey, B: bitcoin::PublicKey, @@ -296,7 +296,7 @@ impl State1 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State2 { a: bitcoin::SecretKey, B: bitcoin::PublicKey, @@ -371,7 +371,7 @@ impl State2 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State3 { a: bitcoin::SecretKey, B: bitcoin::PublicKey, @@ -424,7 +424,7 @@ impl State3 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State4 { a: bitcoin::SecretKey, B: bitcoin::PublicKey, @@ -527,7 +527,7 @@ impl State4 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State5 { a: bitcoin::SecretKey, B: bitcoin::PublicKey, @@ -618,7 +618,7 @@ impl State5 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State6 { a: bitcoin::SecretKey, B: bitcoin::PublicKey, diff --git a/xmr-btc/src/bob.rs b/xmr-btc/src/bob.rs index b9109e09..53bf1431 100644 --- a/xmr-btc/src/bob.rs +++ b/xmr-btc/src/bob.rs @@ -58,16 +58,13 @@ pub async fn next_state< } State::State3(state3) => { let message2: alice::Message2 = transport.receive_message().await?.try_into()?; - let state4 = state3.watch_for_lock_xmr(monero_wallet, message2).await?; tracing::info!("bob has seen that alice has locked xmr"); Ok(state4.into()) } State::State4(state4) => { transport.send_message(state4.next_message().into()).await?; - tracing::info!("bob is watching for redeem_btc"); - tokio::time::delay_for(std::time::Duration::new(5, 0)).await; let state5 = state4.watch_for_redeem_btc(bitcoin_wallet).await?; tracing::info!("bob has seen that alice has redeemed btc"); state5.claim_xmr(monero_wallet).await?; @@ -231,7 +228,7 @@ impl State0 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State1 { A: bitcoin::PublicKey, b: bitcoin::SecretKey, @@ -294,7 +291,7 @@ impl State1 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State2 { A: bitcoin::PublicKey, b: bitcoin::SecretKey, @@ -365,7 +362,7 @@ impl State2 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State3 { A: bitcoin::PublicKey, b: bitcoin::SecretKey, @@ -471,7 +468,7 @@ impl State3 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State4 { A: bitcoin::PublicKey, b: bitcoin::SecretKey, @@ -538,7 +535,7 @@ impl State4 { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct State5 { A: bitcoin::PublicKey, b: bitcoin::SecretKey,