feat: introduce libp2p-identity crate

This patch combines the `libp2p_core::identity` and `libp2p_core::peer_id` modules into a new crate: `libp2p-identity`.

Resolves https://github.com/libp2p/rust-libp2p/issues/3349.

Pull-Request: #3350.
This commit is contained in:
Thomas Eizinger
2023-03-13 01:46:58 +11:00
committed by GitHub
parent d81f9476f7
commit 2a14df25eb
180 changed files with 1014 additions and 347 deletions

View File

@ -27,7 +27,8 @@ use crate::behaviour::{socket::AsyncSocket, timer::Builder};
use crate::Config;
use futures::Stream;
use if_watch::IfEvent;
use libp2p_core::{Endpoint, Multiaddr, PeerId};
use libp2p_core::{Endpoint, Multiaddr};
use libp2p_identity::PeerId;
use libp2p_swarm::behaviour::FromSwarm;
use libp2p_swarm::{
dummy, ConnectionDenied, ConnectionId, ListenAddresses, NetworkBehaviour,

View File

@ -25,7 +25,8 @@ use self::dns::{build_query, build_query_response, build_service_discovery_respo
use self::query::MdnsPacket;
use crate::behaviour::{socket::AsyncSocket, timer::Builder};
use crate::Config;
use libp2p_core::{Multiaddr, PeerId};
use libp2p_core::Multiaddr;
use libp2p_identity::PeerId;
use libp2p_swarm::ListenAddresses;
use socket2::{Domain, Socket, Type};
use std::{

View File

@ -21,7 +21,8 @@
//! (M)DNS encoding and decoding on top of the `dns_parser` library.
use crate::{META_QUERY_SERVICE, SERVICE_NAME};
use libp2p_core::{Multiaddr, PeerId};
use libp2p_core::Multiaddr;
use libp2p_identity::PeerId;
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};
use std::{borrow::Cow, cmp, error, fmt, str, time::Duration};
@ -395,7 +396,7 @@ impl error::Error for MdnsResponseError {}
#[cfg(test)]
mod tests {
use super::*;
use libp2p_core::identity;
use libp2p_identity as identity;
use std::time::Duration;
use trust_dns_proto::op::Message;

View File

@ -23,8 +23,8 @@ use crate::{META_QUERY_SERVICE_FQDN, SERVICE_NAME_FQDN};
use libp2p_core::{
address_translation,
multiaddr::{Multiaddr, Protocol},
PeerId,
};
use libp2p_identity::PeerId;
use std::time::Instant;
use std::{convert::TryFrom, fmt, net::SocketAddr, str, time::Duration};
use trust_dns_proto::{