Skip to content

Commit

Permalink
fix(kad): re-export NodeStatus
Browse files Browse the repository at this point in the history
The `EntryView` struct exposes the node status however its type is not public making it impossible to use the status field. This change re-exports `NodeStatus`.

Related: #4108.

Pull-Request: #4645.
  • Loading branch information
nathanielc authored Oct 16, 2023
1 parent 43575e9 commit 82902fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## 0.44.6 - unreleased

- Rename `Kademlia` symbols to follow naming convention.
- Rename `Kademlia` symbols to follow naming convention.
See [PR 4547].

- Fix a bug where we didn't detect a remote peer moving into client-state.
See [PR 4639](https://github.com/libp2p/rust-libp2p/pull/4639).
- Re-export `NodeStatus`.
See [PR 4645].

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

<!-- Internal changes
Expand Down
1 change: 1 addition & 0 deletions protocols/kad/src/kbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ mod entry;
#[allow(clippy::assign_op_pattern)]
mod key;

pub use bucket::NodeStatus;
pub use entry::*;

use arrayvec::{self, ArrayVec};
Expand Down
4 changes: 3 additions & 1 deletion protocols/kad/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ pub use behaviour::{
pub use behaviour::{
Behaviour, BucketInserts, Caching, Config, Event, ProgressStep, Quorum, StoreInserts,
};
pub use kbucket::{Distance as KBucketDistance, EntryView, KBucketRef, Key as KBucketKey};
pub use kbucket::{
Distance as KBucketDistance, EntryView, KBucketRef, Key as KBucketKey, NodeStatus,
};
pub use protocol::ConnectionType;
pub use query::QueryId;
pub use record_priv::{store, Key as RecordKey, ProviderRecord, Record};
Expand Down

0 comments on commit 82902fc

Please sign in to comment.