Skip to content

Commit

Permalink
fix(networking): allow wasm32 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee committed Apr 24, 2024
1 parent f75f2d4 commit f5a9f2b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sn_networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use crate::{
use futures::StreamExt;
#[cfg(feature = "local-discovery")]
use libp2p::mdns;
use libp2p::swarm::behaviour::toggle::Toggle;
use libp2p::{
identity::Keypair,
kad::{self, QueryId, Quorum, Record, K_VALUE},
Expand Down Expand Up @@ -167,7 +166,7 @@ pub enum VerificationKind {
#[behaviour(to_swarm = "NodeEvent")]
pub(super) struct NodeBehaviour {
#[cfg(feature = "upnp")]
pub(super) upnp: Toggle<libp2p::upnp::tokio::Behaviour>,
pub(super) upnp: libp2p::swarm::behaviour::toggle::Toggle<libp2p::upnp::tokio::Behaviour>,
pub(super) request_response: request_response::cbor::Behaviour<Request, Response>,
pub(super) kademlia: kad::Behaviour<UnifiedRecordStore>,
#[cfg(feature = "local-discovery")]
Expand All @@ -187,6 +186,7 @@ pub struct NetworkBuilder {
metrics_registry: Option<Registry>,
#[cfg(feature = "open-metrics")]
metrics_server_port: u16,
#[cfg(feature = "upnp")]
upnp: bool,
}

Expand Down Expand Up @@ -294,6 +294,7 @@ impl NetworkBuilder {
};

let listen_addr = self.listen_addr;
#[cfg(feature = "upnp")]
let upnp = self.upnp;

let (network, events_receiver, mut swarm_driver) = self.build(
Expand Down

0 comments on commit f5a9f2b

Please sign in to comment.