-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
} | ||
|
||
public void addCommitSeal(final SignedData<CommitPayload> commitPayload) { | ||
if (!proposalMessage.isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplify to (!proposalMessage.isPresent() || validator.validateCommmitMessage(commitPayload))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less lines of code - but potentially harder read - where do other reviewers fall?
} | ||
|
||
@Test | ||
public void singleVlidatorIsPreparedWithJustProposal() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vlidator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
} | ||
|
||
public void addPreparedPeer(final SignedData<PreparePayload> prepareMsg) { | ||
if (!proposalMessage.isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to below comment. This is simpler as (!proposalMessage.isPresent()) || (validator.validatePrepareMessage(prepareMsg))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested change relies on the || operator precedence, in that the validator will fail the commit message if the proposal is not available.
Would prefer to be explicit rather than implicit.
Appreciate the actual functionality is identical.
The IBFT RoundState is responsible for determining if sufficient valid messages have been received to deem the node "Prepared" or "Committed".
The IBFT RoundState is responsible for determining if sufficient
valid messages have been received to deem the node "Prepared" or
"Committed".