diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index d9367ecf..327a6081 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -172,7 +172,7 @@ where let _ = responder.respond(wallet_snapshot); } SwarmEvent::Behaviour(OutEvent::SwapSetupCompleted{peer_id, swap_id, state3}) => { - let _ = self.handle_execution_setup_done(peer_id, swap_id, *state3).await; + let _ = self.handle_execution_setup_done(peer_id, swap_id, state3).await; } SwarmEvent::Behaviour(OutEvent::SwapDeclined { peer, error }) => { tracing::warn!(%peer, "Ignoring spot price request because: {}", error); diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index a9f7fc4e..60dd594f 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -34,6 +34,7 @@ pub mod behaviour { use libp2p::{NetworkBehaviour, PeerId}; use uuid::Uuid; + #[allow(clippy::large_enum_variant)] #[derive(Debug)] pub enum OutEvent { SwapSetupInitiated { @@ -42,7 +43,7 @@ pub mod behaviour { SwapSetupCompleted { peer_id: PeerId, swap_id: Uuid, - state3: Box, + state3: State3, }, SwapDeclined { peer: PeerId, @@ -57,7 +58,7 @@ pub mod behaviour { id: RequestId, }, EncryptedSignatureReceived { - msg: Box, + msg: encrypted_signature::Request, channel: ResponseChannel<()>, peer: PeerId, }, diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index 15323794..5f2cd8d7 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -52,7 +52,7 @@ impl From<(PeerId, Message)> for asb::OutEvent { Message::Request { request, channel, .. } => Self::EncryptedSignatureReceived { - msg: Box::new(request), + msg: request, channel, peer, }, diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 6930a6f3..9280790a 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -96,7 +96,7 @@ impl From for asb::OutEvent { } => asb::OutEvent::SwapSetupCompleted { peer_id: bob_peer_id, swap_id, - state3: Box::new(state3), + state3, }, OutEvent::Error { peer_id, error } => asb::OutEvent::Failure { peer: peer_id,