slight corrections to attestation validation
This commit is contained in:
parent
7e1819f693
commit
048f8b6f01
@ -16,3 +16,4 @@ pub mod shard_and_committee;
|
||||
pub mod transition;
|
||||
pub mod validator_record;
|
||||
pub mod validation;
|
||||
pub mod helpers;
|
||||
|
@ -1,8 +1,8 @@
|
||||
use super::super::crystallized_state::CrystallizedState;
|
||||
use super::super::active_state::ActiveState;
|
||||
use super::super::attestation_record::AttestationRecord;
|
||||
use super::super::block::Block;
|
||||
use super::super::chain_config::ChainConfig;
|
||||
use super::CrystallizedState;
|
||||
use super::ActiveState;
|
||||
use super::AttestationRecord;
|
||||
use super::Block;
|
||||
use super::ChainConfig;
|
||||
|
||||
use ::utils::errors::AttestationValidationError;
|
||||
|
||||
@ -24,7 +24,7 @@ pub fn validate_attestation(
|
||||
return Err(AttestationValidationError::SlotTooLow(format!("Attestation slot number too low\n\tFound: {:?}, Needed greater than: {:?}", attestation.slot, block.slot_number - chain_config.cycle_length as u64)));
|
||||
}
|
||||
|
||||
return Ok(true);
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,6 @@ mod tests {
|
||||
return (crystallized_state, active_state, attestation_record, block, chain_config);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_attestation_validation_slot_high() {
|
||||
// generate standard state
|
||||
@ -71,7 +70,12 @@ mod tests {
|
||||
attestation_record.slot = 2;
|
||||
block.slot_number = 10;
|
||||
|
||||
let result = validate_attestation(&crystallized_state, &active_state, &attestation_record, &block, &chain_config);
|
||||
let result = validate_attestation(
|
||||
&crystallized_state,
|
||||
&active_state,
|
||||
&attestation_record,
|
||||
&block,
|
||||
&chain_config);
|
||||
//assert_eq!(result, Err(AttestationValidationError::SlotTooLow));
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,7 @@
|
||||
use super::crystallized_state::CrystallizedState;
|
||||
use super::active_state::ActiveState;
|
||||
use super::attestation_record::AttestationRecord;
|
||||
use super::block::Block;
|
||||
use super::chain_config::ChainConfig;
|
||||
|
||||
mod attestation_validation;
|
||||
|
Loading…
Reference in New Issue
Block a user