@Test void performTask_shouldProcessSlotsWhenStateIsBeforeSlot() { final UInt64 epoch = UInt64.valueOf(2); final Checkpoint checkpoint = chainBuilder.getCurrentCheckpointForEpoch(epoch); final BeaconState state = chainBuilder.getStateAtSlot(0); when(stateProvider.getState(checkpoint.getRoot())) .thenReturn(SafeFuture.completedFuture(Optional.of(state))); final CheckpointStateTask task = createTask(epoch, checkpoint.getRoot()); final SafeFuture<Optional<BeaconState>> result = task.performTask(); final BeaconState expectedState = CheckpointStateGenerator.regenerateCheckpointState(checkpoint, state); assertThatSafeFuture(result).isCompletedWithOptionalContaining(expectedState); }
@Override public SafeFuture<Optional<BeaconState>> performTask() { return getBaseState().thenApply(maybeState -> maybeState.map(this::regenerateFromState)); }
CheckpointStateTask implements CacheableTask<Checkpoint, BeaconState> { @Override public SafeFuture<Optional<BeaconState>> performTask() { return getBaseState().thenApply(maybeState -> maybeState.map(this::regenerateFromState)); } }
CheckpointStateTask implements CacheableTask<Checkpoint, BeaconState> { @Override public SafeFuture<Optional<BeaconState>> performTask() { return getBaseState().thenApply(maybeState -> maybeState.map(this::regenerateFromState)); } CheckpointStateTask(final Checkpoint checkpoint, final AsyncStateProvider stateProvider); private  CheckpointStateTask(
      final Checkpoint checkpoint,
      final AsyncStateProvider stateProvider,
      final BeaconState baseState); }
CheckpointStateTask implements CacheableTask<Checkpoint, BeaconState> { @Override public SafeFuture<Optional<BeaconState>> performTask() { return getBaseState().thenApply(maybeState -> maybeState.map(this::regenerateFromState)); } CheckpointStateTask(final Checkpoint checkpoint, final AsyncStateProvider stateProvider); private  CheckpointStateTask(
      final Checkpoint checkpoint,
      final AsyncStateProvider stateProvider,
      final BeaconState baseState); @Override Checkpoint getKey(); @Override Stream<Checkpoint> streamIntermediateSteps(); @Override CacheableTask<Checkpoint, BeaconState> rebase(final BeaconState newBaseValue); @Override SafeFuture<Optional<BeaconState>> performTask(); }
CheckpointStateTask implements CacheableTask<Checkpoint, BeaconState> { @Override public SafeFuture<Optional<BeaconState>> performTask() { return getBaseState().thenApply(maybeState -> maybeState.map(this::regenerateFromState)); } CheckpointStateTask(final Checkpoint checkpoint, final AsyncStateProvider stateProvider); private  CheckpointStateTask(
      final Checkpoint checkpoint,
      final AsyncStateProvider stateProvider,
      final BeaconState baseState); @Override Checkpoint getKey(); @Override Stream<Checkpoint> streamIntermediateSteps(); @Override CacheableTask<Checkpoint, BeaconState> rebase(final BeaconState newBaseValue); @Override SafeFuture<Optional<BeaconState>> performTask();  }