mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-10 07:20:07 -04:00
Restart event loop in tests
Alice was attempting to create a new event loop using the same listen addr as the old one which was still running. This commit aborts the event loop before creating a new one.
This commit is contained in:
parent
77fc5743a2
commit
1597f5336b
11 changed files with 63 additions and 48 deletions
|
@ -96,8 +96,7 @@ async fn main() -> Result<()> {
|
|||
Arc::new(monero_wallet),
|
||||
db_path,
|
||||
listen_addr,
|
||||
)
|
||||
.await;
|
||||
);
|
||||
let (swap, mut event_loop) =
|
||||
alice_factory.with_init_params(swap_amounts).build().await?;
|
||||
|
||||
|
@ -185,8 +184,7 @@ async fn main() -> Result<()> {
|
|||
Arc::new(monero_wallet),
|
||||
db_path,
|
||||
listen_addr,
|
||||
)
|
||||
.await;
|
||||
);
|
||||
let (swap, mut event_loop) = alice_factory.build().await?;
|
||||
|
||||
tokio::spawn(async move { event_loop.run().await });
|
||||
|
|
|
@ -75,7 +75,7 @@ enum InitParams {
|
|||
}
|
||||
|
||||
impl Builder {
|
||||
pub async fn new(
|
||||
pub fn new(
|
||||
seed: Seed,
|
||||
config: Config,
|
||||
swap_id: Uuid,
|
||||
|
@ -210,7 +210,7 @@ impl Builder {
|
|||
EventLoop::new(
|
||||
alice_transport,
|
||||
alice_behaviour,
|
||||
self.listen_address.clone(),
|
||||
self.listen_address(),
|
||||
self.peer_id,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue