add some test cases

This commit is contained in:
Eitan Seri-Levi
2025-06-13 16:58:07 +03:00
parent 92c22ed33e
commit dd7c229844
7 changed files with 294 additions and 7 deletions

View File

@@ -2095,6 +2095,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
)?)
}
// TODO(focil) rename function
/// Produce an `InclusionList` that is valid for the given `slot`.
///
/// The produced `InclusionList` will not be valid until it has been signed by exactly one
@@ -2146,7 +2147,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
};
let current_slot = self.slot()?;
let next_slot = current_slot.safe_add(1)?;
let _next_slot = current_slot.safe_add(1)?;
// Don't bother with the inclusion list if the head is not the current slot.
//

View File

@@ -22,7 +22,6 @@ pub enum GossipInclusionListError {
InvalidSignature,
BeaconChainError(Box<BeaconChainError>),
PriorInclusionListKnown,
InclusionListSeen,
// TODO: equivocation e.g. PriorInclusionListKnown
}
@@ -90,7 +89,6 @@ impl<T: BeaconChainTypes> GossipVerifiedInclusionList<T> {
.map_err(|_| GossipInclusionListError::InvalidCommitteeRoot)?;
if signed_il.message.inclusion_list_committee_root != il_committee.tree_hash_root() {
tracing::error!("INVALID COMMITTEE ROOT");
return Err(GossipInclusionListError::InvalidCommitteeRoot);
}
@@ -122,7 +120,7 @@ impl<T: BeaconChainTypes> GossipVerifiedInclusionList<T> {
}
if chain.inclusion_list_seen(&signed_il) {
return Err(GossipInclusionListError::InclusionListSeen);
return Err(GossipInclusionListError::PriorInclusionListKnown);
}
Ok(Self {