Make #stateprocessingcompileagain

This commit is contained in:
Paul Hauner
2019-05-19 16:56:39 +10:00
parent 29a3e0c868
commit ea96d24420
6 changed files with 89 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
#![cfg(test)]
use crate::per_epoch_processing;
use crate::per_epoch_processing::per_epoch_processing;
use env_logger::{Builder, Env};
use types::test_utils::TestingBeaconStateBuilder;
use types::*;

View File

@@ -232,7 +232,8 @@ impl ValidatorStatuses {
// The inclusion slot and distance are only required for previous epoch attesters.
let attestation_slot = state.get_attestation_slot(&a.data)?;
let inclusion_slot = attestation_slot + a.inclusion_delay;
let relative_epoch = RelativeEpoch::from_slot(state.slot, inclusion_slot, spec)?;
let relative_epoch =
RelativeEpoch::from_slot(state.slot, inclusion_slot, spec.slots_per_epoch)?;
status.inclusion_info = Some(InclusionInfo {
slot: inclusion_slot,
distance: a.inclusion_delay,

View File

@@ -42,7 +42,7 @@ pub fn winning_root<T: EthSpec>(
spec: &ChainSpec,
) -> Result<Option<WinningRoot>, BeaconStateError> {
let shard_attestations: Vec<&PendingAttestation> = state
.get_matching_source_attestations(epoch, spec)?
.get_matching_source_attestations(epoch)?
.iter()
.filter(|a| a.data.shard == shard)
.collect();