mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 14:48:01 +00:00
Move bitswap to its own crate (#12242)
* Introduce `sc-network-bitswap` Move the bitswap protocol out of `sc-network` to its own crate. * Improve test coverage * Remove mention of bitswap from `sc-network` * Fix documentation * Fix clippy and remove the void dependency * Remove unneeded trait bound and bump prost to 0.11
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{
|
||||
bitswap::Bitswap,
|
||||
discovery::{DiscoveryBehaviour, DiscoveryConfig, DiscoveryOut},
|
||||
peer_info,
|
||||
protocol::{message::Roles, CustomMessageOutcome, NotificationsSink, Protocol},
|
||||
@@ -32,8 +31,7 @@ use libp2p::{
|
||||
identify::IdentifyInfo,
|
||||
kad::record,
|
||||
swarm::{
|
||||
behaviour::toggle::Toggle, NetworkBehaviour, NetworkBehaviourAction,
|
||||
NetworkBehaviourEventProcess, PollParameters,
|
||||
NetworkBehaviour, NetworkBehaviourAction, NetworkBehaviourEventProcess, PollParameters,
|
||||
},
|
||||
NetworkBehaviour,
|
||||
};
|
||||
@@ -79,8 +77,6 @@ where
|
||||
peer_info: peer_info::PeerInfoBehaviour,
|
||||
/// Discovers nodes of the network.
|
||||
discovery: DiscoveryBehaviour,
|
||||
/// Bitswap server for blockchain data.
|
||||
bitswap: Toggle<Bitswap<B>>,
|
||||
/// Generic request-response protocols.
|
||||
request_responses: request_responses::RequestResponsesBehaviour,
|
||||
|
||||
@@ -214,7 +210,6 @@ where
|
||||
block_request_protocol_config: ProtocolConfig,
|
||||
state_request_protocol_config: ProtocolConfig,
|
||||
warp_sync_protocol_config: Option<ProtocolConfig>,
|
||||
bitswap: Option<Bitswap<B>>,
|
||||
light_client_request_protocol_config: ProtocolConfig,
|
||||
// All remaining request protocol configs.
|
||||
mut request_response_protocols: Vec<ProtocolConfig>,
|
||||
@@ -239,7 +234,6 @@ where
|
||||
substrate,
|
||||
peer_info: peer_info::PeerInfoBehaviour::new(user_agent, local_public_key),
|
||||
discovery: disco_config.finish(),
|
||||
bitswap: bitswap.into(),
|
||||
request_responses: request_responses::RequestResponsesBehaviour::new(
|
||||
request_response_protocols.into_iter(),
|
||||
peerset,
|
||||
@@ -338,16 +332,6 @@ fn reported_roles_to_observed_role(roles: Roles) -> ObservedRole {
|
||||
}
|
||||
}
|
||||
|
||||
impl<B, Client> NetworkBehaviourEventProcess<void::Void> for Behaviour<B, Client>
|
||||
where
|
||||
B: BlockT,
|
||||
Client: HeaderBackend<B> + 'static,
|
||||
{
|
||||
fn inject_event(&mut self, event: void::Void) {
|
||||
void::unreachable(event)
|
||||
}
|
||||
}
|
||||
|
||||
impl<B, Client> NetworkBehaviourEventProcess<CustomMessageOutcome<B>> for Behaviour<B, Client>
|
||||
where
|
||||
B: BlockT,
|
||||
|
||||
Reference in New Issue
Block a user