use of tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory in project teku by ConsenSys.
the class RewardsTestExecutorAltair method runTest.
@Override
public void runTest(final TestDefinition testDefinition) throws Throwable {
final BeaconState preState = loadStateFromSsz(testDefinition, "pre.ssz_snappy");
final ValidatorStatusFactory statusFactory = testDefinition.getSpec().getGenesisSpec().getValidatorStatusFactory();
final ValidatorStatuses validatorStatuses = statusFactory.createValidatorStatuses(preState);
final SpecVersion spec = testDefinition.getSpec().getGenesisSpec();
final RewardsAndPenaltiesCalculatorAltair calculator = createRewardsAndPenaltiesCalculator(preState, validatorStatuses, spec);
runTest(testDefinition, calculator, validatorStatuses);
}
use of tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory in project teku by ConsenSys.
the class EpochProcessingTestExecutor method runTest.
@Override
public void runTest(final TestDefinition testDefinition) throws Exception {
final BeaconState preState = loadStateFromSsz(testDefinition, "pre.ssz_snappy");
final BeaconState expectedPostState = loadStateFromSsz(testDefinition, "post.ssz_snappy");
final SpecVersion genesisSpec = testDefinition.getSpec().getGenesisSpec();
final EpochProcessor epochProcessor = genesisSpec.getEpochProcessor();
final ValidatorStatusFactory validatorStatusFactory = genesisSpec.getValidatorStatusFactory();
final EpochProcessingExecutor processor = new EpochProcessingExecutor(epochProcessor, validatorStatusFactory);
final BeaconState result = preState.updated(state -> processor.executeOperation(operation, state));
assertThat(result).isEqualTo(expectedPostState);
}
use of tech.pegasys.teku.spec.logic.common.statetransition.epoch.status.ValidatorStatusFactory in project teku by ConsenSys.
the class RewardsTestExecutorPhase0 method runTest.
@Override
public void runTest(final TestDefinition testDefinition) throws Throwable {
final BeaconState preState = loadStateFromSsz(testDefinition, "pre.ssz_snappy");
final ValidatorStatusFactory statusFactory = testDefinition.getSpec().getGenesisSpec().getValidatorStatusFactory();
final ValidatorStatuses validatorStatuses = statusFactory.createValidatorStatuses(preState);
final SpecVersion spec = testDefinition.getSpec().getGenesisSpec();
final RewardsAndPenaltiesCalculatorPhase0 calculator = new RewardsAndPenaltiesCalculatorPhase0(spec.getConfig(), preState, validatorStatuses, spec.miscHelpers(), spec.beaconStateAccessors());
runTest(testDefinition, calculator);
}
Aggregations