Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions polkadot/primitives/src/vstaging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,14 @@ pub enum CommittedCandidateReceiptError {
/// The core index in commitments doesn't match the one in descriptor
#[cfg_attr(
feature = "std",
error("The core index in commitments doesn't match the one in descriptor")
error("The core index in commitments ({commitments:?}) doesn't match the one in descriptor ({descriptor:?})")
)]
CoreIndexMismatch,
CoreIndexMismatch {
/// The core index as found in the descriptor.
descriptor: CoreIndex,
/// The core index as found in the commitments.
commitments: CoreIndex,
},
/// The core selector or claim queue offset is invalid.
#[cfg_attr(feature = "std", error("The core selector or claim queue offset is invalid"))]
InvalidSelectedCore,
Expand Down Expand Up @@ -787,7 +792,10 @@ impl<H: Copy> CommittedCandidateReceiptV2<H> {
.copied()?;

if core_index != descriptor_core_index {
return Err(CommittedCandidateReceiptError::CoreIndexMismatch)
return Err(CommittedCandidateReceiptError::CoreIndexMismatch {
descriptor: descriptor_core_index,
commitments: core_index,
})
}

Ok(())
Expand Down Expand Up @@ -1368,7 +1376,10 @@ mod candidate_receipt_tests {
new_ccr.descriptor.set_core_index(CoreIndex(1));
assert_eq!(
new_ccr.parse_ump_signals(&cq),
Err(CommittedCandidateReceiptError::CoreIndexMismatch)
Err(CommittedCandidateReceiptError::CoreIndexMismatch {
descriptor: CoreIndex(1),
commitments: CoreIndex(0),
})
);
}

Expand Down
Loading