Skip to content

Commit

Permalink
type alias
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
  • Loading branch information
sandreim committed Sep 24, 2024
1 parent 9c4e2ae commit 43bbb9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions polkadot/primitives/src/vstaging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ impl<H: Copy> CommittedCandidateReceiptV2<H> {
/// between `ParaId` and the cores assigned per depth.
pub fn check_core_index(
&self,
cores_per_para: &BTreeMap<ParaId, BTreeMap<u8, BTreeSet<CoreIndex>>>,
cores_per_para: &TransposedClaimQueue,
) -> Result<(), CandidateReceiptError> {
match self.descriptor.version() {
// Don't check v1 descriptors.
Expand Down Expand Up @@ -750,11 +750,14 @@ impl<H: Copy> From<CoreState<H>> for super::v8::CoreState<H> {
}
}

/// The claim queue mapped by parachain id.
pub type TransposedClaimQueue = BTreeMap<ParaId, BTreeMap<u8, BTreeSet<CoreIndex>>>;

/// Returns a mapping between the para id and the core indices assigned at different
/// depths in the claim queue.
pub fn transpose_claim_queue(
claim_queue: BTreeMap<CoreIndex, VecDeque<Id>>,
) -> BTreeMap<ParaId, BTreeMap<u8, BTreeSet<CoreIndex>>> {
) -> TransposedClaimQueue {
let mut per_para_claim_queue = BTreeMap::new();

for (core, paras) in claim_queue {
Expand Down

0 comments on commit 43bbb9d

Please sign in to comment.