@Test void performTask_shouldRegenerateState() { chainBuilder.generateBlocksUpToSlot(3); final StateGenerationTask task = createTask(0, 3); final SafeFuture<Optional<SignedBlockAndState>> result = task.performTask(); assertThatSafeFuture(result) .isCompletedWithOptionalContaining(chainBuilder.getBlockAndStateAtSlot(3)); assertRequestedBlockRangeInclusive(0, 3); }
@Override public SafeFuture<Optional<SignedBlockAndState>> performTask() { return resolveAgainstLatestEpochBoundary() .thenCompose(StateGenerationTask::regenerateState) .thenApply(Optional::of); }
StateGenerationTask implements CacheableTask<Bytes32, SignedBlockAndState> { @Override public SafeFuture<Optional<SignedBlockAndState>> performTask() { return resolveAgainstLatestEpochBoundary() .thenCompose(StateGenerationTask::regenerateState) .thenApply(Optional::of); } }
StateGenerationTask implements CacheableTask<Bytes32, SignedBlockAndState> { @Override public SafeFuture<Optional<SignedBlockAndState>> performTask() { return resolveAgainstLatestEpochBoundary() .thenCompose(StateGenerationTask::regenerateState) .thenApply(Optional::of); } StateGenerationTask(
      final Bytes32 blockRoot,
      final HashTree tree,
      final SignedBlockAndState baseBlockAndState,
      final Optional<Bytes32> epochBoundaryRoot,
      final BlockProvider blockProvider,
      final StateAndBlockProvider stateAndBlockProvider); }
StateGenerationTask implements CacheableTask<Bytes32, SignedBlockAndState> { @Override public SafeFuture<Optional<SignedBlockAndState>> performTask() { return resolveAgainstLatestEpochBoundary() .thenCompose(StateGenerationTask::regenerateState) .thenApply(Optional::of); } StateGenerationTask(
      final Bytes32 blockRoot,
      final HashTree tree,
      final SignedBlockAndState baseBlockAndState,
      final Optional<Bytes32> epochBoundaryRoot,
      final BlockProvider blockProvider,
      final StateAndBlockProvider stateAndBlockProvider); @Override Bytes32 getKey(); @Override Stream<Bytes32> streamIntermediateSteps(); @Override StateGenerationTask rebase(final SignedBlockAndState newBaseBlockAndState); @Override SafeFuture<Optional<SignedBlockAndState>> performTask(); }
StateGenerationTask implements CacheableTask<Bytes32, SignedBlockAndState> { @Override public SafeFuture<Optional<SignedBlockAndState>> performTask() { return resolveAgainstLatestEpochBoundary() .thenCompose(StateGenerationTask::regenerateState) .thenApply(Optional::of); } StateGenerationTask(
      final Bytes32 blockRoot,
      final HashTree tree,
      final SignedBlockAndState baseBlockAndState,
      final Optional<Bytes32> epochBoundaryRoot,
      final BlockProvider blockProvider,
      final StateAndBlockProvider stateAndBlockProvider); @Override Bytes32 getKey(); @Override Stream<Bytes32> streamIntermediateSteps(); @Override StateGenerationTask rebase(final SignedBlockAndState newBaseBlockAndState); @Override SafeFuture<Optional<SignedBlockAndState>> performTask();  }