@@ -594,9 +594,14 @@ pub enum CommittedCandidateReceiptError {
594
594
/// The core index in commitments doesn't match the one in descriptor
595
595
#[ cfg_attr(
596
596
feature = "std" ,
597
- error( "The core index in commitments doesn't match the one in descriptor" )
597
+ error( "The core index in commitments ({commitments:?}) doesn't match the one in descriptor ({descriptor:?}) " )
598
598
) ]
599
- CoreIndexMismatch ,
599
+ CoreIndexMismatch {
600
+ /// The core index as found in the descriptor.
601
+ descriptor : CoreIndex ,
602
+ /// The core index as found in the commitments.
603
+ commitments : CoreIndex ,
604
+ } ,
600
605
/// The core selector or claim queue offset is invalid.
601
606
#[ cfg_attr( feature = "std" , error( "The core selector or claim queue offset is invalid" ) ) ]
602
607
InvalidSelectedCore ,
@@ -787,7 +792,10 @@ impl<H: Copy> CommittedCandidateReceiptV2<H> {
787
792
. copied ( ) ?;
788
793
789
794
if core_index != descriptor_core_index {
790
- return Err ( CommittedCandidateReceiptError :: CoreIndexMismatch )
795
+ return Err ( CommittedCandidateReceiptError :: CoreIndexMismatch {
796
+ descriptor : descriptor_core_index,
797
+ commitments : core_index,
798
+ } )
791
799
}
792
800
793
801
Ok ( ( ) )
@@ -1368,7 +1376,10 @@ mod candidate_receipt_tests {
1368
1376
new_ccr. descriptor . set_core_index ( CoreIndex ( 1 ) ) ;
1369
1377
assert_eq ! (
1370
1378
new_ccr. parse_ump_signals( & cq) ,
1371
- Err ( CommittedCandidateReceiptError :: CoreIndexMismatch )
1379
+ Err ( CommittedCandidateReceiptError :: CoreIndexMismatch {
1380
+ descriptor: CoreIndex ( 1 ) ,
1381
+ commitments: CoreIndex ( 0 ) ,
1382
+ } )
1372
1383
) ;
1373
1384
}
1374
1385
0 commit comments