mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Remove async block when it is not needed
This commit is contained in:
parent
e079b84500
commit
297b15e3ce
@ -320,6 +320,6 @@ async fn bob_swap(
|
|||||||
swap_id,
|
swap_id,
|
||||||
);
|
);
|
||||||
|
|
||||||
tokio::spawn(async move { event_loop.run().await });
|
tokio::spawn(event_loop.run());
|
||||||
swap.await
|
swap.await
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ async fn given_alice_restarts_after_encsig_is_learned_resume_swap() {
|
|||||||
|
|
||||||
let (mut event_loop_after_restart, event_loop_handle_after_restart) =
|
let (mut event_loop_after_restart, event_loop_handle_after_restart) =
|
||||||
testutils::init_alice_event_loop(alice_multiaddr);
|
testutils::init_alice_event_loop(alice_multiaddr);
|
||||||
let _alice_swarm_fut = tokio::spawn(async move { event_loop_after_restart.run().await });
|
tokio::spawn(async move { event_loop_after_restart.run().await });
|
||||||
|
|
||||||
let db_swap = alice_db.get_state(alice_swap_id).unwrap();
|
let db_swap = alice_db.get_state(alice_swap_id).unwrap();
|
||||||
let resume_state = AliceState::try_from(db_swap).unwrap();
|
let resume_state = AliceState::try_from(db_swap).unwrap();
|
||||||
|
@ -80,22 +80,19 @@ async fn given_bob_restarts_after_encsig_is_sent_resume_swap() {
|
|||||||
let bob_btc_wallet_clone = bob_btc_wallet.clone();
|
let bob_btc_wallet_clone = bob_btc_wallet.clone();
|
||||||
let bob_xmr_wallet_clone = bob_xmr_wallet.clone();
|
let bob_xmr_wallet_clone = bob_xmr_wallet.clone();
|
||||||
|
|
||||||
let alice_swap_handle = tokio::spawn(async move {
|
let alice_swap_handle = tokio::spawn(alice::swap::swap(
|
||||||
alice::swap::swap(
|
alice_state,
|
||||||
alice_state,
|
alice_event_loop_handle,
|
||||||
alice_event_loop_handle,
|
alice_btc_wallet.clone(),
|
||||||
alice_btc_wallet.clone(),
|
alice_xmr_wallet.clone(),
|
||||||
alice_xmr_wallet.clone(),
|
config,
|
||||||
config,
|
Uuid::new_v4(),
|
||||||
Uuid::new_v4(),
|
alice_db,
|
||||||
alice_db,
|
));
|
||||||
)
|
|
||||||
.await
|
|
||||||
});
|
|
||||||
|
|
||||||
tokio::spawn(async move { alice_event_loop.run().await });
|
tokio::spawn(async move { alice_event_loop.run().await });
|
||||||
|
|
||||||
tokio::spawn(async move { bob_event_loop.run().await });
|
tokio::spawn(bob_event_loop.run());
|
||||||
|
|
||||||
let bob_swap_id = Uuid::new_v4();
|
let bob_swap_id = Uuid::new_v4();
|
||||||
let bob_db_datadir = tempdir().unwrap();
|
let bob_db_datadir = tempdir().unwrap();
|
||||||
@ -125,7 +122,7 @@ async fn given_bob_restarts_after_encsig_is_sent_resume_swap() {
|
|||||||
|
|
||||||
let (event_loop_after_restart, event_loop_handle_after_restart) =
|
let (event_loop_after_restart, event_loop_handle_after_restart) =
|
||||||
testutils::init_bob_event_loop(alice_peer_id, alice_multiaddr);
|
testutils::init_bob_event_loop(alice_peer_id, alice_multiaddr);
|
||||||
let _bob_swarm_fut = tokio::spawn(async move { event_loop_after_restart.run().await });
|
tokio::spawn(event_loop_after_restart.run());
|
||||||
|
|
||||||
let db_swap = bob_db.get_state(bob_swap_id).unwrap();
|
let db_swap = bob_db.get_state(bob_swap_id).unwrap();
|
||||||
let resume_state = BobState::try_from(db_swap).unwrap();
|
let resume_state = BobState::try_from(db_swap).unwrap();
|
||||||
|
@ -100,7 +100,7 @@ async fn given_alice_restarts_after_xmr_is_locked_abort_swap() {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
tokio::spawn(async move { bob_event_loop.run().await });
|
tokio::spawn(bob_event_loop.run());
|
||||||
|
|
||||||
// We are selecting with alice_event_loop_1 so that we stop polling on it once
|
// We are selecting with alice_event_loop_1 so that we stop polling on it once
|
||||||
// the try_join is finished.
|
// the try_join is finished.
|
||||||
|
Loading…
Reference in New Issue
Block a user