Update attestation_validator for spec updates

This commit is contained in:
Paul Hauner 2018-12-13 17:33:16 +11:00
parent 96c2012434
commit 493a16ac18
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C
2 changed files with 3 additions and 2 deletions

View File

@ -12,8 +12,9 @@ use super::{Error, Invalid, Outcome};
pub fn validate_attestation_justified_slot(
data: &AttestationData,
state: &BeaconState,
epoch_length: u64,
) -> Result<Outcome, Error> {
let permissable_justified_slot = if data.slot >= state.latest_state_recalculation_slot {
let permissable_justified_slot = if data.slot >= state.slot - (state.slot % epoch_length) {
state.justified_slot
} else {
state.previous_justified_slot

View File

@ -19,7 +19,7 @@ where
match state.latest_crosslinks.get(data.shard as usize) {
None => reject!(Invalid::UnknownShard),
Some(crosslink) => {
let local_shard_block_hash = crosslink.shard_block_hash;
let local_shard_block_hash = crosslink.shard_block_root;
let shard_block_hash_is_permissable = {
(local_shard_block_hash == data.latest_crosslink_hash)
|| (local_shard_block_hash == data.shard_block_hash)