mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 13:24:44 +00:00
Ensure that parent_block.slot < block.slot
This commit is contained in:
@@ -94,6 +94,22 @@ fn test_block_validation_valid_known_block() {
|
||||
assert_eq!(status.unwrap(), (BlockStatus::KnownBlock, None));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_block_validation_parent_slot_too_high() {
|
||||
let params = get_simple_params();
|
||||
|
||||
let mutator = |mut block: Block, attester_map, proposer_map, stores| {
|
||||
block.slot_number = params.validation_context_justified_slot + 1;
|
||||
(block, attester_map, proposer_map, stores)
|
||||
};
|
||||
|
||||
let status = run_block_validation_scenario(
|
||||
¶ms,
|
||||
mutator);
|
||||
|
||||
assert_eq!(status, Err(SszBlockValidationError::ParentSlotHigherThanBlockSlot));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_block_validation_invalid_future_slot() {
|
||||
let params = get_simple_params();
|
||||
|
||||
Reference in New Issue
Block a user