Allow deprecated type in Swarm (#486)

We have to use the type of the upstream dependency
This commit is contained in:
Giacomo Pasini 2023-10-27 17:47:53 +02:00 committed by GitHub
parent 54dd96dfff
commit c84c3fb93b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,7 @@ pub use libp2p;
use blake2::digest::{consts::U32, Digest}; use blake2::digest::{consts::U32, Digest};
use blake2::Blake2b; use blake2::Blake2b;
use libp2p::gossipsub::{Message, MessageId, TopicHash}; use libp2p::gossipsub::{Message, MessageId, TopicHash};
#[allow(deprecated)]
pub use libp2p::{ pub use libp2p::{
core::upgrade, core::upgrade,
dns, dns,
@ -151,6 +151,7 @@ impl Swarm {
} }
impl futures::Stream for Swarm { impl futures::Stream for Swarm {
#[allow(deprecated)]
type Item = SwarmEvent<BehaviourEvent, THandlerErr<Behaviour>>; type Item = SwarmEvent<BehaviourEvent, THandlerErr<Behaviour>>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {

View File

@ -1,6 +1,7 @@
use std::{collections::HashMap, ops::Range, time::Duration}; use std::{collections::HashMap, ops::Range, time::Duration};
use mixnet_client::MixnetClient; use mixnet_client::MixnetClient;
#[allow(deprecated)]
use nomos_libp2p::{ use nomos_libp2p::{
gossipsub::{self, Message}, gossipsub::{self, Message},
libp2p::swarm::ConnectionId, libp2p::swarm::ConnectionId,
@ -88,6 +89,7 @@ impl SwarmHandler {
} }
} }
#[allow(deprecated)]
fn handle_event(&mut self, event: SwarmEvent<BehaviourEvent, THandlerErr<Behaviour>>) { fn handle_event(&mut self, event: SwarmEvent<BehaviourEvent, THandlerErr<Behaviour>>) {
match event { match event {
SwarmEvent::Behaviour(BehaviourEvent::Gossipsub(gossipsub::Event::Message { SwarmEvent::Behaviour(BehaviourEvent::Gossipsub(gossipsub::Event::Message {