From eefbaffe4fb51cd4d9c733c57a67068369f71825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 10 Feb 2020 10:32:34 +0100 Subject: [PATCH] Be specific about the `BitVec` generic arguments (#830) * Be specific about the `BitVec` generic arguments Currently we use the default generic arguments for `BitVec`. This means we use `BigEndian` and `u8`. These default values are not stable, with `0.17` of the `BitVec` crate this changes. To make sure we don't break anything in the future, make sure we explictly set the generics. * Update `spec_version` --- polkadot/primitives/src/parachain.rs | 2 +- polkadot/runtime/common/src/registrar.rs | 2 +- polkadot/runtime/kusama/src/lib.rs | 2 +- polkadot/validation/src/shared_table/mod.rs | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/polkadot/primitives/src/parachain.rs b/polkadot/primitives/src/parachain.rs index eb359f388f..8b1381e872 100644 --- a/polkadot/primitives/src/parachain.rs +++ b/polkadot/primitives/src/parachain.rs @@ -516,7 +516,7 @@ pub struct AttestedCandidate { /// Validity attestations. pub validity_votes: Vec, /// Indices of the corresponding validity votes. - pub validator_indices: BitVec, + pub validator_indices: BitVec, } impl AttestedCandidate { diff --git a/polkadot/runtime/common/src/registrar.rs b/polkadot/runtime/common/src/registrar.rs index 21fde017ce..e4f97c61dd 100644 --- a/polkadot/runtime/common/src/registrar.rs +++ b/polkadot/runtime/common/src/registrar.rs @@ -862,7 +862,7 @@ mod tests { .collect(), validator_indices: roster.iter() .map(|i| i == &Chain::Parachain(id)) - .collect::(), + .collect::>(), } } diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 62692cd2a6..4eefe33896 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -77,7 +77,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kusama"), impl_name: create_runtime_str!("parity-kusama"), authoring_version: 2, - spec_version: 1046, + spec_version: 1047, impl_version: 0, apis: RUNTIME_API_VERSIONS, }; diff --git a/polkadot/validation/src/shared_table/mod.rs b/polkadot/validation/src/shared_table/mod.rs index 69d6e7fd1e..b33c2bbc7c 100644 --- a/polkadot/validation/src/shared_table/mod.rs +++ b/polkadot/validation/src/shared_table/mod.rs @@ -519,7 +519,11 @@ impl SharedTable { }).collect(); validity_votes.sort_by(|(id1, _), (id2, _)| id1.cmp(id2)); - let mut validator_indices = bitvec![0; validity_votes.last().map(|(i, _)| i + 1).unwrap_or_default()]; + let mut validator_indices = bitvec![ + bitvec::cursor::LittleEndian, u8; + 0; + validity_votes.last().map(|(i, _)| i + 1).unwrap_or_default() + ]; for (id, _) in &validity_votes { validator_indices.set(*id, true); }