Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(libp2p): expose builder phase error #5726

Merged
merged 9 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libp2p/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ mod phase;
mod select_muxer;
mod select_security;

#[cfg(all(not(target_arch = "wasm32"), feature = "websocket"))]
pub use phase::WebsocketError;
pub use phase::{BehaviourError, TransportError};

/// Build a [`Swarm`](libp2p_swarm::Swarm) by combining an identity, a set of
/// [`Transport`](libp2p_core::Transport)s and a
/// [`NetworkBehaviour`](libp2p_swarm::NetworkBehaviour).
Expand Down
4 changes: 4 additions & 0 deletions libp2p/src/builder/phase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ mod websocket;

use bandwidth_logging::*;
use bandwidth_metrics::*;
pub use behaviour::BehaviourError;
use behaviour::*;
use build::*;
use dns::*;
use libp2p_core::{muxing::StreamMuxerBox, Transport};
use libp2p_identity::Keypair;
pub use other_transport::TransportError;
use other_transport::*;
use provider::*;
use quic::*;
use relay::*;
use swarm::*;
use tcp::*;
#[cfg(all(not(target_arch = "wasm32"), feature = "websocket"))]
pub use websocket::WebsocketError;
drHuangMHT marked this conversation as resolved.
Show resolved Hide resolved
use websocket::*;

use super::{
Expand Down
7 changes: 6 additions & 1 deletion libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,17 @@ pub mod bandwidth;
#[cfg(doc)]
pub mod tutorials;

#[cfg(all(not(target_arch = "wasm32"), feature = "websocket"))]
pub use builder::WebsocketError as WebsocketBuilderError;
pub use libp2p_identity as identity;
pub use libp2p_identity::PeerId;
pub use libp2p_swarm::{Stream, StreamProtocol};

pub use self::{
builder::SwarmBuilder,
builder::{
BehaviourError as BehaviourBuilderError, SwarmBuilder,
TransportError as TransportBuilderError,
},
core::{
transport::TransportError,
upgrade::{InboundUpgrade, OutboundUpgrade},
Expand Down
Loading