From c84c3fb93bde91cab58f65736f793d9cd31d87de Mon Sep 17 00:00:00 2001 From: Giacomo Pasini <21265557+zeegomo@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:47:53 +0200 Subject: [PATCH] Allow deprecated type in Swarm (#486) We have to use the type of the upstream dependency --- nomos-libp2p/src/lib.rs | 3 ++- nomos-services/network/src/backends/libp2p/swarm.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nomos-libp2p/src/lib.rs b/nomos-libp2p/src/lib.rs index d2d96989..faf4596e 100644 --- a/nomos-libp2p/src/lib.rs +++ b/nomos-libp2p/src/lib.rs @@ -12,7 +12,7 @@ pub use libp2p; use blake2::digest::{consts::U32, Digest}; use blake2::Blake2b; use libp2p::gossipsub::{Message, MessageId, TopicHash}; - +#[allow(deprecated)] pub use libp2p::{ core::upgrade, dns, @@ -151,6 +151,7 @@ impl Swarm { } impl futures::Stream for Swarm { + #[allow(deprecated)] type Item = SwarmEvent>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { diff --git a/nomos-services/network/src/backends/libp2p/swarm.rs b/nomos-services/network/src/backends/libp2p/swarm.rs index f82ec490..14d16997 100644 --- a/nomos-services/network/src/backends/libp2p/swarm.rs +++ b/nomos-services/network/src/backends/libp2p/swarm.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, ops::Range, time::Duration}; use mixnet_client::MixnetClient; +#[allow(deprecated)] use nomos_libp2p::{ gossipsub::{self, Message}, libp2p::swarm::ConnectionId, @@ -88,6 +89,7 @@ impl SwarmHandler { } } + #[allow(deprecated)] fn handle_event(&mut self, event: SwarmEvent>) { match event { SwarmEvent::Behaviour(BehaviourEvent::Gossipsub(gossipsub::Event::Message {