mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
add some test cases
This commit is contained in:
@@ -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.
|
||||
//
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user