mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-23 23:01:33 +00:00
chore(gossipsub): include in libp2p
meta crate when compiling for wasm
Since https://github.com/libp2p/rust-libp2p/pull/3973, gossipsub now fully supports wasm targets. It functions properly when added as a dependency on its own. However, when trying to use it under libp2p by activating a feature, it's not possible and the compiler will raise an error like `unresolved import libp2p::gossipsub`. This pull request enables the use of gossipsub for wasm targets when it's activated as a feature of the libp2p dependency. Pull-Request: #4217.
This commit is contained in:
@ -30,7 +30,6 @@
|
||||
#[cfg(feature = "dcutr")]
|
||||
mod dcutr;
|
||||
#[cfg(feature = "gossipsub")]
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
mod gossipsub;
|
||||
#[cfg(feature = "identify")]
|
||||
mod identify;
|
||||
@ -50,7 +49,6 @@ pub struct Metrics {
|
||||
#[cfg(feature = "dcutr")]
|
||||
dcutr: dcutr::Metrics,
|
||||
#[cfg(feature = "gossipsub")]
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
gossipsub: gossipsub::Metrics,
|
||||
#[cfg(feature = "identify")]
|
||||
identify: identify::Metrics,
|
||||
@ -78,7 +76,6 @@ impl Metrics {
|
||||
#[cfg(feature = "dcutr")]
|
||||
dcutr: dcutr::Metrics::new(sub_registry),
|
||||
#[cfg(feature = "gossipsub")]
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
gossipsub: gossipsub::Metrics::new(sub_registry),
|
||||
#[cfg(feature = "identify")]
|
||||
identify: identify::Metrics::new(sub_registry),
|
||||
@ -107,7 +104,6 @@ impl Recorder<libp2p_dcutr::Event> for Metrics {
|
||||
}
|
||||
|
||||
#[cfg(feature = "gossipsub")]
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
impl Recorder<libp2p_gossipsub::Event> for Metrics {
|
||||
fn record(&self, event: &libp2p_gossipsub::Event) {
|
||||
self.gossipsub.record(event)
|
||||
|
Reference in New Issue
Block a user