Fix issues with per_epoch block_root calls

They were being called with the wrong slot.
This commit is contained in:
Paul Hauner
2019-01-31 18:28:54 +11:00
parent 5c44f97fba
commit 3f13c25c05
3 changed files with 13 additions and 8 deletions

View File

@@ -30,8 +30,9 @@ where
.ok_or_else(|| Error::SlotTooOld)?;
let head_slot = self.head().beacon_block.slot;
let previous_epoch_start_slot = head_slot - (head_slot % self.spec.epoch_length);
let epoch_boundary_root = *state
.get_block_root(head_slot % self.spec.epoch_length, &self.spec)
.get_block_root(previous_epoch_start_slot, &self.spec)
.ok_or_else(|| Error::SlotTooOld)?;
Ok(AttestationData {