mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
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`
This commit is contained in:
@@ -516,7 +516,7 @@ pub struct AttestedCandidate {
|
|||||||
/// Validity attestations.
|
/// Validity attestations.
|
||||||
pub validity_votes: Vec<ValidityAttestation>,
|
pub validity_votes: Vec<ValidityAttestation>,
|
||||||
/// Indices of the corresponding validity votes.
|
/// Indices of the corresponding validity votes.
|
||||||
pub validator_indices: BitVec,
|
pub validator_indices: BitVec<bitvec::cursor::LittleEndian, u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AttestedCandidate {
|
impl AttestedCandidate {
|
||||||
|
|||||||
@@ -862,7 +862,7 @@ mod tests {
|
|||||||
.collect(),
|
.collect(),
|
||||||
validator_indices: roster.iter()
|
validator_indices: roster.iter()
|
||||||
.map(|i| i == &Chain::Parachain(id))
|
.map(|i| i == &Chain::Parachain(id))
|
||||||
.collect::<BitVec>(),
|
.collect::<BitVec::<_, _>>(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("kusama"),
|
spec_name: create_runtime_str!("kusama"),
|
||||||
impl_name: create_runtime_str!("parity-kusama"),
|
impl_name: create_runtime_str!("parity-kusama"),
|
||||||
authoring_version: 2,
|
authoring_version: 2,
|
||||||
spec_version: 1046,
|
spec_version: 1047,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -519,7 +519,11 @@ impl SharedTable {
|
|||||||
}).collect();
|
}).collect();
|
||||||
validity_votes.sort_by(|(id1, _), (id2, _)| id1.cmp(id2));
|
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 {
|
for (id, _) in &validity_votes {
|
||||||
validator_indices.set(*id, true);
|
validator_indices.set(*id, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user