From 6534f13619f652412e654c2545bf8a4c3df75f0c Mon Sep 17 00:00:00 2001 From: StemCll Date: Sat, 23 Sep 2023 23:04:47 +0200 Subject: [PATCH] Bump swarm & add CHANGELOG entry; fix NewExternalAddrOfPeer docs --- Cargo.lock | 2 +- Cargo.toml | 2 +- swarm/CHANGELOG.md | 6 ++++++ swarm/Cargo.toml | 2 +- swarm/src/behaviour.rs | 7 +++---- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab743782e466..ec380c4d8fdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3039,7 +3039,7 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.43.4" +version = "0.44.0" dependencies = [ "async-std", "either", diff --git a/Cargo.toml b/Cargo.toml index 9005af855146..de1cb00fd676 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,7 +100,7 @@ libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" } libp2p-upnp = { version = "0.1.0", path = "protocols/upnp" } libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" } libp2p-server = { version = "0.12.3", path = "misc/server" } -libp2p-swarm = { version = "0.43.4", path = "swarm" } +libp2p-swarm = { version = "0.44.0", path = "swarm" } libp2p-swarm-derive = { version = "0.34.0", path = "swarm-derive" } libp2p-swarm-test = { version = "0.2.0", path = "swarm-test" } libp2p-tcp = { version = "0.40.0", path = "transports/tcp" } diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 2d5fcfe542d0..fd22edb15220 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.44.0 + +- Add `FromSwarm::NewExternalAddrOfPeer` event. + +[PR 4371]: https://github.com/libp2p/rust-libp2p/pull/4371 + ## 0.43.4 - Implement `Debug` for event structs. diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index 86f4c1583873..095a0abf94c6 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-swarm" edition = "2021" rust-version = { workspace = true } description = "The libp2p swarm" -version = "0.43.4" +version = "0.44.0" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/swarm/src/behaviour.rs b/swarm/src/behaviour.rs index c1553c88e6fb..ee1bb5418ede 100644 --- a/swarm/src/behaviour.rs +++ b/swarm/src/behaviour.rs @@ -321,8 +321,7 @@ pub enum ToSwarm { connection: CloseConnection, }, - /// TODO: more documentation needed - /// Reports external address of a remote peer to other `NetworkBehaviours` + /// Reports external address of a remote peer to other [`NetworkBehaviours`]. NewExternalAddrOfPeer { peer_id: PeerId, addr: Multiaddr }, } @@ -458,7 +457,7 @@ pub enum FromSwarm<'a, Handler> { ExternalAddrConfirmed(ExternalAddrConfirmed<'a>), /// Informs the behaviour that an external address of the local node expired, i.e. is no-longer confirmed. ExternalAddrExpired(ExternalAddrExpired<'a>), - /// TODO: document it + /// Informs the behaviour that we have discovered a new external address for a remote peer. NewExternalAddrOfPeer(NewExternalAddrOfPeer<'a>), } @@ -573,7 +572,7 @@ pub struct ExternalAddrExpired<'a> { pub addr: &'a Multiaddr, } -/// [`FromSwarm`] variant that informs the behaviour that a new external address was detected. +/// [`FromSwarm`] variant that informs the behaviour that a new external address for a remote peer was detected. #[derive(Clone, Copy, Debug)] pub struct NewExternalAddrOfPeer<'a> { pub peer_id: &'a PeerId,