Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/: Add display implementation for DialError<THandler> #2456

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@

# `libp2p` facade crate

## Version 0.42.2 [unreleased]

- Update individual crates.
- `libp2p-core`

## Version 0.42.1 [2022-02-02]

- Update individual crates.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p"
edition = "2021"
rust-version = "1.56.1"
description = "Peer-to-peer networking library"
version = "0.42.1"
version = "0.42.2"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down Expand Up @@ -77,7 +77,7 @@ instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature
lazy_static = "1.2"

libp2p-autonat = { version = "0.1.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.31.0", path = "core", default-features = false }
libp2p-core = { version = "0.31.1", path = "core", default-features = false }
libp2p-floodsub = { version = "0.33.0", path = "protocols/floodsub", optional = true }
libp2p-gossipsub = { version = "0.35.0", path = "./protocols/gossipsub", optional = true }
libp2p-identify = { version = "0.33.0", path = "protocols/identify", optional = true }
Expand Down
6 changes: 6 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.31.1 [unreleased]

- Implement `Display` on `DialError`. See [PR 2456].

[PR 2456]: https://github.com/libp2p/rust-libp2p/pull/2456

# 0.31.0 [2022-01-27]

- Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-core"
edition = "2021"
rust-version = "1.56.1"
description = "Core traits and structs of libp2p"
version = "0.31.0"
version = "0.31.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
4 changes: 4 additions & 0 deletions core/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,12 +572,16 @@ impl NetworkConfig {
#[derive(Debug, Clone, Error)]
pub enum DialError<THandler> {
/// The dialing attempt is rejected because of a connection limit.
#[error("The dialing attempt was rejected because of a connection limit: {limit}")]
ConnectionLimit {
limit: ConnectionLimit,
handler: THandler,
},
/// The dialing attempt is rejected because the peer being dialed is the local peer.
#[error("The dialing attempt was rejected because the peer being dialed is the local peer")]
LocalPeerId { handler: THandler },
/// The dialing attempt is rejected because the PeerId is invalid.
#[error("The dialing attempt was rejected because a valid PeerId could not be constructed from: {multihash:?}")]
InvalidPeerId {
handler: THandler,
multihash: Multihash,
Expand Down