Incorporate sc-peerset into sc-network (#14236)

This commit is contained in:
Dmitry Markin
2023-05-29 20:56:57 +03:00
committed by GitHub
parent b8bca85e9d
commit d4b2bf7394
40 changed files with 306 additions and 337 deletions
@@ -34,7 +34,9 @@
//! - If provided, a ["requests processing"](ProtocolConfig::inbound_queue) channel
//! is used to handle incoming requests.
use crate::{types::ProtocolName, ReputationChange};
use crate::{
peer_store::BANNED_THRESHOLD, peerset::PeersetHandle, types::ProtocolName, ReputationChange,
};
use futures::{channel::oneshot, prelude::*};
use libp2p::{
@@ -49,8 +51,6 @@ use libp2p::{
PeerId,
};
use sc_peerset::{PeersetHandle, BANNED_THRESHOLD};
use std::{
collections::{hash_map::Entry, HashMap},
io, iter,
@@ -1040,6 +1040,7 @@ impl Codec for GenericCodec {
mod tests {
use super::*;
use crate::peerset::{Peerset, PeersetConfig, SetConfig};
use futures::{channel::oneshot, executor::LocalPool, task::Spawn};
use libp2p::{
core::{
@@ -1051,7 +1052,6 @@ mod tests {
swarm::{Executor, Swarm, SwarmBuilder, SwarmEvent},
Multiaddr,
};
use sc_peerset::{Peerset, PeersetConfig, SetConfig};
use std::{iter, time::Duration};
struct TokioExecutor(tokio::runtime::Runtime);