mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-19 04:51:22 +00:00
protocols/identify: Revise symbol naming (#2927)
This commit is contained in:
@ -39,8 +39,7 @@ use libp2p::{
|
||||
either::EitherTransport, muxing::StreamMuxerBox, transport, transport::upgrade::Version,
|
||||
},
|
||||
gossipsub::{self, Gossipsub, GossipsubConfigBuilder, GossipsubEvent, MessageAuthenticity},
|
||||
identify::{Identify, IdentifyConfig, IdentifyEvent},
|
||||
identity,
|
||||
identify, identity,
|
||||
multiaddr::Protocol,
|
||||
noise, ping,
|
||||
pnet::{PnetConfig, PreSharedKey},
|
||||
@ -157,13 +156,13 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
#[behaviour(out_event = "MyBehaviourEvent")]
|
||||
struct MyBehaviour {
|
||||
gossipsub: Gossipsub,
|
||||
identify: Identify,
|
||||
identify: identify::Behaviour,
|
||||
ping: ping::Behaviour,
|
||||
}
|
||||
|
||||
enum MyBehaviourEvent {
|
||||
Gossipsub(GossipsubEvent),
|
||||
Identify(IdentifyEvent),
|
||||
Identify(identify::Event),
|
||||
Ping(ping::Event),
|
||||
}
|
||||
|
||||
@ -173,8 +172,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<IdentifyEvent> for MyBehaviourEvent {
|
||||
fn from(event: IdentifyEvent) -> Self {
|
||||
impl From<identify::Event> for MyBehaviourEvent {
|
||||
fn from(event: identify::Event) -> Self {
|
||||
MyBehaviourEvent::Identify(event)
|
||||
}
|
||||
}
|
||||
@ -197,7 +196,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
gossipsub_config,
|
||||
)
|
||||
.expect("Valid configuration"),
|
||||
identify: Identify::new(IdentifyConfig::new(
|
||||
identify: identify::Behaviour::new(identify::Config::new(
|
||||
"/ipfs/0.1.0".into(),
|
||||
local_key.public(),
|
||||
)),
|
||||
|
Reference in New Issue
Block a user