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

feat(kad): allow to explicitly set Mode::{Client,Server} #4132

Merged
merged 33 commits into from
Jul 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ef09472
feat: Add Kademlia::set_explicit_mode
dariusc93 Jun 29, 2023
a62fa23
chore: Return on ExplicitMode::Auto
dariusc93 Jun 29, 2023
94e8ddf
chore: Formatted code
dariusc93 Jun 29, 2023
d9f7ab8
chore: Remove ExplicitMode and add auto_mode and waker field
dariusc93 Jun 30, 2023
048607b
chore: Remove ExplicitMode
dariusc93 Jun 30, 2023
437be0f
chore: Move into a single function
dariusc93 Jun 30, 2023
884ce0c
chore: Group fields together
dariusc93 Jun 30, 2023
6faeade
chore: added test set_client_to_server_mode
dariusc93 Jul 1, 2023
b7f55b7
Merge branch 'master' into kad-explicit-mode
dariusc93 Jul 1, 2023
ce2bb2a
chore: Update test
dariusc93 Jul 1, 2023
7e93c8b
Merge branch 'kad-explicit-mode' of github.com:dariusc93/rust-libp2p …
dariusc93 Jul 1, 2023
bb42582
chore: Update CHANGELOG.md
dariusc93 Jul 1, 2023
6521bff
Merge branch 'master' into kad-explicit-mode
dariusc93 Jul 2, 2023
35f8013
Merge branch 'kad-explicit-mode' of github.com:dariusc93/rust-libp2p …
dariusc93 Jul 2, 2023
0423bcb
chore: Redetermine mode when setting mode to None
dariusc93 Jul 2, 2023
a3f43ce
Update protocols/kad/tests/client_mode.rs
dariusc93 Jul 2, 2023
7974cef
Update protocols/kad/src/behaviour.rs
dariusc93 Jul 2, 2023
f53172c
Merge branch 'kad-explicit-mode' of github.com:dariusc93/rust-libp2p …
dariusc93 Jul 2, 2023
bc260c7
fix: Correct test
dariusc93 Jul 2, 2023
f23a7f9
chore: Format code
dariusc93 Jul 2, 2023
82be8cd
Update protocols/kad/CHANGELOG.md
dariusc93 Jul 3, 2023
9af4772
chore: if statement into reconfigure_mode
dariusc93 Jul 3, 2023
bb18f70
chore: Move log into reconfigure_mode
dariusc93 Jul 3, 2023
5613545
Update protocols/kad/src/behaviour.rs
dariusc93 Jul 3, 2023
9ed97ed
Merge branch 'master' into kad-explicit-mode
dariusc93 Jul 3, 2023
39481fe
chore: Rename method
dariusc93 Jul 3, 2023
6e37c3c
chore: Return early and minor cleanup
dariusc93 Jul 3, 2023
aed03b7
Update protocols/kad/src/behaviour.rs
dariusc93 Jul 3, 2023
2b588e2
Merge branch 'kad-explicit-mode' of github.com:dariusc93/rust-libp2p …
dariusc93 Jul 3, 2023
6f500d3
Merge branch 'master' into kad-explicit-mode
dariusc93 Jul 3, 2023
365b3c5
chore: Update version
dariusc93 Jul 3, 2023
2ffb5ff
Merge branch 'kad-explicit-mode' of github.com:dariusc93/rust-libp2p …
dariusc93 Jul 3, 2023
2592177
chore: Bump version
dariusc93 Jul 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Remove ExplicitMode
  • Loading branch information
dariusc93 committed Jun 30, 2023
commit 048607bc091b47c29e9f0b860f6333d7f96eca2d
17 changes: 0 additions & 17 deletions protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
@@ -3312,23 +3312,6 @@ impl fmt::Display for Mode {
}
}

#[derive(PartialEq, Copy, Clone, Debug)]
pub enum ExplicitMode {
Auto,
Client,
Server,
}

impl fmt::Display for ExplicitMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ExplicitMode::Auto => write!(f, "auto"),
ExplicitMode::Client => write!(f, "client"),
ExplicitMode::Server => write!(f, "server"),
}
}
}

fn to_comma_separated_list<T>(confirmed_external_addresses: &[T]) -> String
where
T: ToString,