|
|
@ -128,7 +128,7 @@ public class NewRoundMessageValidatorTest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void newRoundTargettingRoundZeroFails() { |
|
|
|
public void newRoundTargetingRoundZeroFails() { |
|
|
|
msgBuilder.setRoundChangeIdentifier( |
|
|
|
msgBuilder.setRoundChangeIdentifier( |
|
|
|
new ConsensusRoundIdentifier(roundIdentifier.getSequenceNumber(), 0)); |
|
|
|
new ConsensusRoundIdentifier(roundIdentifier.getSequenceNumber(), 0)); |
|
|
|
|
|
|
|
|
|
|
@ -205,7 +205,7 @@ public class NewRoundMessageValidatorTest { |
|
|
|
public void roundChangeMessagesDoNotAllTargetRoundOfNewRoundMsgFails() { |
|
|
|
public void roundChangeMessagesDoNotAllTargetRoundOfNewRoundMsgFails() { |
|
|
|
final ConsensusRoundIdentifier prevRound = TestHelpers.createFrom(roundIdentifier, 0, -1); |
|
|
|
final ConsensusRoundIdentifier prevRound = TestHelpers.createFrom(roundIdentifier, 0, -1); |
|
|
|
|
|
|
|
|
|
|
|
RoundChangeCertificate.Builder roundChangeBuilder = new RoundChangeCertificate.Builder(); |
|
|
|
final RoundChangeCertificate.Builder roundChangeBuilder = new RoundChangeCertificate.Builder(); |
|
|
|
roundChangeBuilder.appendRoundChangeMessage( |
|
|
|
roundChangeBuilder.appendRoundChangeMessage( |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload(roundIdentifier, Optional.empty())); |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload(roundIdentifier, Optional.empty())); |
|
|
|
roundChangeBuilder.appendRoundChangeMessage( |
|
|
|
roundChangeBuilder.appendRoundChangeMessage( |
|
|
@ -222,7 +222,7 @@ public class NewRoundMessageValidatorTest { |
|
|
|
public void invalidEmbeddedRoundChangeMessageFails() { |
|
|
|
public void invalidEmbeddedRoundChangeMessageFails() { |
|
|
|
final ConsensusRoundIdentifier prevRound = TestHelpers.createFrom(roundIdentifier, 0, -1); |
|
|
|
final ConsensusRoundIdentifier prevRound = TestHelpers.createFrom(roundIdentifier, 0, -1); |
|
|
|
|
|
|
|
|
|
|
|
RoundChangeCertificate.Builder roundChangeBuilder = new RoundChangeCertificate.Builder(); |
|
|
|
final RoundChangeCertificate.Builder roundChangeBuilder = new RoundChangeCertificate.Builder(); |
|
|
|
roundChangeBuilder.appendRoundChangeMessage( |
|
|
|
roundChangeBuilder.appendRoundChangeMessage( |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload( |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload( |
|
|
|
roundIdentifier, |
|
|
|
roundIdentifier, |
|
|
@ -260,8 +260,6 @@ public class NewRoundMessageValidatorTest { |
|
|
|
differentProposal, |
|
|
|
differentProposal, |
|
|
|
Lists.newArrayList( |
|
|
|
Lists.newArrayList( |
|
|
|
validatorMessageFactory.createSignedPreparePayload( |
|
|
|
validatorMessageFactory.createSignedPreparePayload( |
|
|
|
roundIdentifier, proposedBlock.getHash()), |
|
|
|
|
|
|
|
otherValidatorMessageFactory.createSignedPreparePayload( |
|
|
|
|
|
|
|
roundIdentifier, proposedBlock.getHash())))); |
|
|
|
roundIdentifier, proposedBlock.getHash())))); |
|
|
|
|
|
|
|
|
|
|
|
// An earlier PrepareCert is added to ensure the path to find the latest PrepareCert
|
|
|
|
// An earlier PrepareCert is added to ensure the path to find the latest PrepareCert
|
|
|
@ -277,8 +275,6 @@ public class NewRoundMessageValidatorTest { |
|
|
|
earlierProposal, |
|
|
|
earlierProposal, |
|
|
|
Lists.newArrayList( |
|
|
|
Lists.newArrayList( |
|
|
|
validatorMessageFactory.createSignedPreparePayload( |
|
|
|
validatorMessageFactory.createSignedPreparePayload( |
|
|
|
earlierPreparedRound, proposedBlock.getHash()), |
|
|
|
|
|
|
|
otherValidatorMessageFactory.createSignedPreparePayload( |
|
|
|
|
|
|
|
earlierPreparedRound, proposedBlock.getHash())))); |
|
|
|
earlierPreparedRound, proposedBlock.getHash())))); |
|
|
|
|
|
|
|
|
|
|
|
final SignedData<NewRoundPayload> msg = |
|
|
|
final SignedData<NewRoundPayload> msg = |
|
|
@ -287,9 +283,7 @@ public class NewRoundMessageValidatorTest { |
|
|
|
new RoundChangeCertificate( |
|
|
|
new RoundChangeCertificate( |
|
|
|
Lists.newArrayList( |
|
|
|
Lists.newArrayList( |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload( |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload( |
|
|
|
roundIdentifier, earlierPreparedCert), |
|
|
|
roundIdentifier, earlierPreparedCert))), |
|
|
|
proposerMessageFactory.createSignedRoundChangePayload( |
|
|
|
|
|
|
|
roundIdentifier, preparedCert))), |
|
|
|
|
|
|
|
proposal); |
|
|
|
proposal); |
|
|
|
proposerMessageFactory.createSignedProposalPayload(roundIdentifier, proposedBlock); |
|
|
|
proposerMessageFactory.createSignedProposalPayload(roundIdentifier, proposedBlock); |
|
|
|
|
|
|
|
|
|
|
|