Migrate polkadot-primitives to v6 (#1543)

- Async-backing related primitives are stable `primitives::v6`
- Async-backing API is now part of `api_version(7)`
- It's enabled on Rococo and Westend runtimes

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
This commit is contained in:
Chris Sosnin
2023-09-27 13:32:02 +03:00
committed by GitHub
parent 5a2833cceb
commit 7cbe0c76ef
107 changed files with 2410 additions and 2792 deletions
@@ -23,7 +23,7 @@ use sc_network::PeerId;
use polkadot_primitives::AuthorityDiscoveryId;
use super::{v1, vstaging, IsRequest, Protocol};
use super::{v1, v2, IsRequest, Protocol};
/// All requests that can be sent to the network bridge via `NetworkBridgeTxMessage::SendRequest`.
#[derive(Debug)]
@@ -42,10 +42,10 @@ pub enum Requests {
DisputeSendingV1(OutgoingRequest<v1::DisputeRequest>),
/// Request a candidate and attestations.
AttestedCandidateVStaging(OutgoingRequest<vstaging::AttestedCandidateRequest>),
AttestedCandidateV2(OutgoingRequest<v2::AttestedCandidateRequest>),
/// Fetch a collation from a collator which previously announced it.
/// Compared to V1 it requires specifying which candidate is requested by its hash.
CollationFetchingVStaging(OutgoingRequest<vstaging::CollationFetchingRequest>),
CollationFetchingV2(OutgoingRequest<v2::CollationFetchingRequest>),
}
impl Requests {
@@ -54,12 +54,12 @@ impl Requests {
match self {
Self::ChunkFetchingV1(_) => Protocol::ChunkFetchingV1,
Self::CollationFetchingV1(_) => Protocol::CollationFetchingV1,
Self::CollationFetchingVStaging(_) => Protocol::CollationFetchingVStaging,
Self::CollationFetchingV2(_) => Protocol::CollationFetchingV2,
Self::PoVFetchingV1(_) => Protocol::PoVFetchingV1,
Self::AvailableDataFetchingV1(_) => Protocol::AvailableDataFetchingV1,
Self::StatementFetchingV1(_) => Protocol::StatementFetchingV1,
Self::DisputeSendingV1(_) => Protocol::DisputeSendingV1,
Self::AttestedCandidateVStaging(_) => Protocol::AttestedCandidateVStaging,
Self::AttestedCandidateV2(_) => Protocol::AttestedCandidateV2,
}
}
@@ -74,12 +74,12 @@ impl Requests {
match self {
Self::ChunkFetchingV1(r) => r.encode_request(),
Self::CollationFetchingV1(r) => r.encode_request(),
Self::CollationFetchingVStaging(r) => r.encode_request(),
Self::CollationFetchingV2(r) => r.encode_request(),
Self::PoVFetchingV1(r) => r.encode_request(),
Self::AvailableDataFetchingV1(r) => r.encode_request(),
Self::StatementFetchingV1(r) => r.encode_request(),
Self::DisputeSendingV1(r) => r.encode_request(),
Self::AttestedCandidateVStaging(r) => r.encode_request(),
Self::AttestedCandidateV2(r) => r.encode_request(),
}
}
}