mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
Refactor multiaddr crate. (#498)
Refactor multiaddr crate. - Remove `AddrComponent`. Instead `Protocol` directly contains its associated data. - Various smaller changes around conversions to Multiaddr from other types, e.g. socket addresses. - Expand tests to include property tests which test encoding/decoding identity.
This commit is contained in:
@ -46,7 +46,7 @@ use futures::sync::mpsc;
|
||||
use futures::{future, Future, Poll, Sink, Stream};
|
||||
use libp2p_core::{ConnectionUpgrade, Endpoint, PeerId};
|
||||
use log::Level;
|
||||
use multiaddr::{AddrComponent, Multiaddr};
|
||||
use multiaddr::{Protocol, Multiaddr};
|
||||
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard};
|
||||
use protobuf::Message as ProtobufMessage;
|
||||
use smallvec::SmallVec;
|
||||
@ -602,7 +602,7 @@ fn handle_packet_received(
|
||||
}
|
||||
};
|
||||
|
||||
let from: Multiaddr = AddrComponent::P2P(peer_id.into()).into();
|
||||
let from: Multiaddr = Protocol::P2p(peer_id.into()).into();
|
||||
|
||||
let topics = publish
|
||||
.take_topicIDs()
|
||||
|
Reference in New Issue
Block a user