Skip to content

Commit

Permalink
fix Identifier usage
Browse files Browse the repository at this point in the history
Signed-off-by: Leni <leniram159@gmail.com>
  • Loading branch information
leniram159 committed Jun 24, 2024
1 parent 1568133 commit 3636c1e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public BftEvents.Type getType() {
/**
* Gets round identifier.
*
* @return the round indentifier
* @return the round Identifier
*/
public ConsensusRoundIdentifier getRoundIndentifier() {
public ConsensusRoundIdentifier getRoundIdentifier() {
return roundIdentifier;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ public void handleNewBlockEvent(final NewChainHead newChainHead) {

@Override
public void handleBlockTimerExpiry(final BlockTimerExpiry blockTimerExpiry) {
final ConsensusRoundIdentifier roundIndentifier = blockTimerExpiry.getRoundIndentifier();
if (isMsgForCurrentHeight(roundIndentifier)) {
getCurrentHeightManager().handleBlockTimerExpiry(roundIndentifier);
final ConsensusRoundIdentifier roundIdentifier = blockTimerExpiry.getRoundIdentifier();
if (isMsgForCurrentHeight(roundIdentifier)) {
getCurrentHeightManager().handleBlockTimerExpiry(roundIdentifier);
} else {
LOG.trace(
"Block timer event discarded as it is not for current block height chainHeight={} eventHeight={}",
getCurrentHeightManager().getChainHeight(),
roundIndentifier.getSequenceNumber());
roundIdentifier.getSequenceNumber());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void aBlockTimerExpiryEventIsAddedToTheQueueOnExpiry() throws Interrupted
assertThat(eventQueue.size()).isEqualTo(1);
final BftEvent queuedEvent = eventQueue.poll(0, TimeUnit.SECONDS);
assertThat(queuedEvent).isInstanceOf(BlockTimerExpiry.class);
assertThat(((BlockTimerExpiry) queuedEvent).getRoundIndentifier())
assertThat(((BlockTimerExpiry) queuedEvent).getRoundIdentifier())
.usingRecursiveComparison()
.isEqualTo(round);
}
Expand Down Expand Up @@ -171,7 +171,7 @@ public void eventIsImmediatelyAddedToTheQueueIfAbsoluteExpiryIsEqualToNow() {
verify(mockQueue).add(bftEventCaptor.capture());

assertThat(bftEventCaptor.getValue() instanceof BlockTimerExpiry).isTrue();
assertThat(((BlockTimerExpiry) bftEventCaptor.getValue()).getRoundIndentifier())
assertThat(((BlockTimerExpiry) bftEventCaptor.getValue()).getRoundIdentifier())
.usingRecursiveComparison()
.isEqualTo(round);
}
Expand Down Expand Up @@ -201,7 +201,7 @@ public void eventIsImmediatelyAddedToTheQueueIfAbsoluteExpiryIsInThePast() {
verify(mockQueue).add(bftEventCaptor.capture());

assertThat(bftEventCaptor.getValue() instanceof BlockTimerExpiry).isTrue();
assertThat(((BlockTimerExpiry) bftEventCaptor.getValue()).getRoundIndentifier())
assertThat(((BlockTimerExpiry) bftEventCaptor.getValue()).getRoundIdentifier())
.usingRecursiveComparison()
.isEqualTo(round);
}
Expand Down

0 comments on commit 3636c1e

Please sign in to comment.