mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-12 16:55:46 +00:00
refactor overseer into proc-macro based pattern (#2962)
This commit is contained in:
committed by
GitHub
parent
2510bfc5d7
commit
3c9104daff
@@ -29,7 +29,7 @@ use sc_network::PeerId;
|
||||
use polkadot_node_network_protocol::request_response::{
|
||||
request::IncomingRequest, v1, Protocol, RequestResponseConfig,
|
||||
};
|
||||
use polkadot_subsystem::messages::AllMessages;
|
||||
use polkadot_overseer::AllMessages;
|
||||
|
||||
/// Multiplex incoming network requests.
|
||||
///
|
||||
@@ -151,28 +151,28 @@ fn multiplex_single(
|
||||
}: network::IncomingRequest,
|
||||
) -> Result<AllMessages, RequestMultiplexError> {
|
||||
let r = match p {
|
||||
Protocol::ChunkFetching => From::from(IncomingRequest::new(
|
||||
Protocol::ChunkFetching => AllMessages::from(IncomingRequest::new(
|
||||
peer,
|
||||
decode_with_peer::<v1::ChunkFetchingRequest>(peer, payload)?,
|
||||
pending_response,
|
||||
)),
|
||||
Protocol::CollationFetching => From::from(IncomingRequest::new(
|
||||
Protocol::CollationFetching => AllMessages::from(IncomingRequest::new(
|
||||
peer,
|
||||
decode_with_peer::<v1::CollationFetchingRequest>(peer, payload)?,
|
||||
pending_response,
|
||||
)),
|
||||
Protocol::PoVFetching => From::from(IncomingRequest::new(
|
||||
Protocol::PoVFetching => AllMessages::from(IncomingRequest::new(
|
||||
peer,
|
||||
decode_with_peer::<v1::PoVFetchingRequest>(peer, payload)?,
|
||||
pending_response,
|
||||
)),
|
||||
Protocol::AvailableDataFetching => From::from(IncomingRequest::new(
|
||||
Protocol::AvailableDataFetching => AllMessages::from(IncomingRequest::new(
|
||||
peer,
|
||||
decode_with_peer::<v1::AvailableDataFetchingRequest>(peer, payload)?,
|
||||
pending_response,
|
||||
)),
|
||||
Protocol::StatementFetching => {
|
||||
panic!("Statement fetching requests are handled directly. qed.");
|
||||
unreachable!("Statement fetching requests are handled directly. qed.");
|
||||
}
|
||||
};
|
||||
Ok(r)
|
||||
|
||||
Reference in New Issue
Block a user