mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 04:37:57 +00:00
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:
@@ -118,16 +118,9 @@ impl PeerSet {
|
||||
/// Networking layer relies on `get_main_version()` being the version
|
||||
/// of the main protocol name reported by [`PeerSetProtocolNames::get_main_name()`].
|
||||
pub fn get_main_version(self) -> ProtocolVersion {
|
||||
#[cfg(not(feature = "network-protocol-staging"))]
|
||||
match self {
|
||||
PeerSet::Validation => ValidationVersion::V1.into(),
|
||||
PeerSet::Collation => CollationVersion::V1.into(),
|
||||
}
|
||||
|
||||
#[cfg(feature = "network-protocol-staging")]
|
||||
match self {
|
||||
PeerSet::Validation => ValidationVersion::VStaging.into(),
|
||||
PeerSet::Collation => CollationVersion::VStaging.into(),
|
||||
PeerSet::Validation => ValidationVersion::V2.into(),
|
||||
PeerSet::Collation => CollationVersion::V2.into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +145,7 @@ impl PeerSet {
|
||||
PeerSet::Validation =>
|
||||
if version == ValidationVersion::V1.into() {
|
||||
Some("validation/1")
|
||||
} else if version == ValidationVersion::VStaging.into() {
|
||||
} else if version == ValidationVersion::V2.into() {
|
||||
Some("validation/2")
|
||||
} else {
|
||||
None
|
||||
@@ -160,7 +153,7 @@ impl PeerSet {
|
||||
PeerSet::Collation =>
|
||||
if version == CollationVersion::V1.into() {
|
||||
Some("collation/1")
|
||||
} else if version == CollationVersion::VStaging.into() {
|
||||
} else if version == CollationVersion::V2.into() {
|
||||
Some("collation/2")
|
||||
} else {
|
||||
None
|
||||
@@ -223,8 +216,8 @@ impl From<ProtocolVersion> for u32 {
|
||||
pub enum ValidationVersion {
|
||||
/// The first version.
|
||||
V1 = 1,
|
||||
/// The staging version.
|
||||
VStaging = 2,
|
||||
/// The second version.
|
||||
V2 = 2,
|
||||
}
|
||||
|
||||
/// Supported collation protocol versions. Only versions defined here must be used in the codebase.
|
||||
@@ -232,8 +225,8 @@ pub enum ValidationVersion {
|
||||
pub enum CollationVersion {
|
||||
/// The first version.
|
||||
V1 = 1,
|
||||
/// The staging version.
|
||||
VStaging = 2,
|
||||
/// The second version.
|
||||
V2 = 2,
|
||||
}
|
||||
|
||||
/// Marker indicating the version is unknown.
|
||||
|
||||
Reference in New Issue
Block a user