Skip to content

Commit

Permalink
fixes unit tests (Consensys#4346)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Sep 17, 2021
1 parent be2a5b1 commit 6a3dfc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private BeaconBlock assertBlockCreated(final int blockSlot, final Spec spec)

final BeaconBlock block =
blockFactory.createUnsignedBlock(
previousState, Optional.empty(), newSlot, randaoReveal, Optional.empty());
previousState, Optional.empty(), newSlot, randaoReveal, Optional.empty(), UInt64.ZERO);

assertThat(block).isNotNull();
assertThat(block.getSlot()).isEqualTo(newSlot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,25 @@ public void createUnsignedBlock_shouldCreateBlock() throws Exception {
when(chainDataClient.getStateAtSlotExact(newSlot))
.thenReturn(SafeFuture.completedFuture(Optional.of(blockSlotState)));
when(blockFactory.createUnsignedBlock(
previousState, Optional.of(blockSlotState), newSlot, randaoReveal, Optional.empty()))
previousState,
Optional.of(blockSlotState),
newSlot,
randaoReveal,
Optional.empty(),
ZERO))
.thenReturn(createdBlock);

final SafeFuture<Optional<BeaconBlock>> result =
validatorApiHandler.createUnsignedBlock(newSlot, randaoReveal, Optional.empty());

verify(blockFactory)
.createUnsignedBlock(
previousState, Optional.of(blockSlotState), newSlot, randaoReveal, Optional.empty());
previousState,
Optional.of(blockSlotState),
newSlot,
randaoReveal,
Optional.empty(),
ZERO);
assertThat(result).isCompletedWithValue(Optional.of(createdBlock));
}

Expand Down

0 comments on commit 6a3dfc2

Please sign in to comment.