Remove genesis_epoch from ChainSpec

This commit is contained in:
Paul Hauner
2019-06-08 08:17:42 -04:00
parent e74d49fc8a
commit caddeba81b
16 changed files with 34 additions and 38 deletions

View File

@@ -39,7 +39,7 @@ pub fn process_rewards_and_penalties<T: EthSpec>(
winning_root_for_shards: &WinningRootHashSet,
spec: &ChainSpec,
) -> Result<(), Error> {
if state.current_epoch() == spec.genesis_epoch {
if state.current_epoch() == T::genesis_epoch() {
return Ok(());
}

View File

@@ -13,7 +13,8 @@ fn runs_without_error() {
let mut builder: TestingBeaconStateBuilder<FewValidatorsEthSpec> =
TestingBeaconStateBuilder::from_deterministic_keypairs(8, &spec);
let target_slot = (spec.genesis_epoch + 4).end_slot(FewValidatorsEthSpec::slots_per_epoch());
let target_slot = (FewValidatorsEthSpec::genesis_epoch() + 4)
.end_slot(FewValidatorsEthSpec::slots_per_epoch());
builder.teleport_to_slot(target_slot, &spec);
let (mut state, _keypairs) = builder.build();