Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix unoccupied bitfields #4004

Merged
3 commits merged into from
Oct 4, 2021
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: 8 additions & 11 deletions runtime/parachains/src/inclusion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ pub mod pallet {
NotCollatorSigned,
/// The validation data hash does not match expected.
ValidationDataHashMismatch,
/// Internal error only returned when compiled with debug assertions.
InternalError,
/// The downward message queue is not processed correctly.
IncorrectDownwardMessageHandling,
/// At least one upward message sent does not pass the acceptance criteria.
Expand Down Expand Up @@ -328,8 +326,6 @@ impl<T: Config> Pallet<T> {
candidate_pending_availability.availability_votes.get_mut(val_idx)
}) {
*bit = true;
} else if cfg!(debug_assertions) {
ensure!(false, Error::<T>::InternalError);
}
}

Expand Down Expand Up @@ -1412,13 +1408,14 @@ mod tests {
bare_bitfield,
&signing_context,
));

assert!(ParaInclusion::process_bitfields(
expected_bits(),
vec![signed.into()],
&core_lookup,
)
.is_err());
assert_eq!(
ParaInclusion::process_bitfields(
expected_bits(),
vec![signed.into()],
&core_lookup,
),
Ok(vec![])
);
}

// empty bitfield signed: always OK, but kind of useless.
Expand Down