Skip to content
Snippets Groups Projects
Commit aa5dd3d8 authored by Aaro Altonen's avatar Aaro Altonen Committed by GitHub
Browse files

Companion for paritytech/substrate#12489 (#1766)

* Companion for paritytech/substrate#12489

* fmt

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: parity-processbot <>
parent 48b3a122
Branches
No related merge requests found
This diff is collapsed.
......@@ -26,6 +26,7 @@ use sc_network_common::{
NonDefaultSetConfig, NonReservedPeerMode, NotificationHandshake, ProtocolId, SetConfig,
},
protocol::role::Roles,
service::NetworkSyncForkRequest,
sync::{message::BlockAnnouncesHandshake, Metrics, SyncStatus},
};
use sc_network_light::light_client_requests;
......@@ -92,6 +93,7 @@ pub(crate) fn build_collator_network(
protocol_id,
metrics_registry: config.prometheus_config.as_ref().map(|config| config.registry.clone()),
block_announce_config,
chain_sync_service: Box::new(DummyChainSyncService::<Block>(Default::default())),
block_request_protocol_config,
state_request_protocol_config,
warp_sync_protocol_config: None,
......@@ -420,6 +422,14 @@ impl<B: BlockT> sc_network_common::sync::ChainSync<B> for DummyChainSync {
) -> Result<sc_network_common::sync::OpaqueStateResponse, String> {
unimplemented!("Not supported on the RPC collator")
}
fn poll(
&mut self,
_cx: &mut std::task::Context,
) -> std::task::Poll<sc_network_common::sync::PollBlockAnnounceValidation<<B as BlockT>::Header>>
{
std::task::Poll::Pending
}
}
struct DummyImportQueue;
......@@ -448,3 +458,9 @@ impl sc_service::ImportQueue<Block> for DummyImportQueue {
) {
}
}
struct DummyChainSyncService<B>(std::marker::PhantomData<B>);
impl<B: BlockT> NetworkSyncForkRequest<B::Hash, NumberFor<B>> for DummyChainSyncService<B> {
fn set_sync_fork_request(&self, _peers: Vec<PeerId>, _hash: B::Hash, _number: NumberFor<B>) {}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment