Skip to content

Commit

Permalink
chore(kad): remove unrequired generics
Browse files Browse the repository at this point in the history
Remove the unrequired generics in `kad` and refactor the code for less duplication.
Please review by commit order as it will be easier to understand each commit's rational and logic

Pull-Request: #5476.
  • Loading branch information
jxs authored Jun 27, 2024
1 parent df59f4f commit 63313f4
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 214 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ libp2p = { version = "0.54.0", path = "libp2p" }
libp2p-allow-block-list = { version = "0.3.0", path = "misc/allow-block-list" }
libp2p-autonat = { version = "0.12.1", path = "protocols/autonat" }
libp2p-connection-limits = { version = "0.3.1", path = "misc/connection-limits" }
libp2p-core = { version = "0.41.4", path = "core" }
libp2p-core = { version = "0.41.3", path = "core" }
libp2p-dcutr = { version = "0.11.1", path = "protocols/dcutr" }
libp2p-dns = { version = "0.41.1", path = "transports/dns" }
libp2p-floodsub = { version = "0.44.0", path = "protocols/floodsub" }
Expand Down
6 changes: 1 addition & 5 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
## 0.41.4
- Add `PeerInfo` struct.
See [PR 5475](https://github.com/libp2p/rust-libp2p/pull/5475)

## 0.41.3
## 0.41.3
- Use `web-time` instead of `instant`.
See [PR 5347](https://github.com/libp2p/rust-libp2p/pull/5347).

Expand Down
6 changes: 3 additions & 3 deletions 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 = { workspace = true }
description = "Core traits and structs of libp2p"
version = "0.41.4"
version = "0.41.3"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down Expand Up @@ -35,8 +35,8 @@ void = "1"

[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
libp2p-mplex = { path = "../muxers/mplex" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
libp2p-noise = { path = "../transports/noise" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
libp2p-mplex = { path = "../muxers/mplex" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
libp2p-noise = { path = "../transports/noise" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
multihash = { workspace = true, features = ["arb"] }
quickcheck = { workspace = true }
libp2p-identity = { workspace = true, features = ["ed25519", "rand"] }
Expand Down
7 changes: 0 additions & 7 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,3 @@ pub use upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo};
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
pub struct DecodeError(quick_protobuf::Error);

/// Peer Info combines a Peer ID with a set of multiaddrs that the peer is listening on.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PeerInfo {
pub peer_id: PeerId,
pub addrs: Vec<Multiaddr>,
}
Loading

0 comments on commit 63313f4

Please sign in to comment.