use of com.radixdlt.hotstuff.QuorumCertificate in project radixdlt by radixdlt.
the class PacemakerStateTest method highQCFor.
private HighQC highQCFor(View view) {
HighQC highQC = mock(HighQC.class);
QuorumCertificate hqc = mock(QuorumCertificate.class);
QuorumCertificate cqc = mock(QuorumCertificate.class);
when(hqc.getView()).thenReturn(view);
when(cqc.getView()).thenReturn(View.of(0));
when(highQC.highestQC()).thenReturn(hqc);
when(highQC.highestCommittedQC()).thenReturn(cqc);
when(highQC.getHighestView()).thenReturn(view);
return highQC;
}
use of com.radixdlt.hotstuff.QuorumCertificate in project radixdlt by radixdlt.
the class PacemakerTest method setUp.
@Before
public void setUp() {
HighQC highQC = mock(HighQC.class);
QuorumCertificate committedQc = mock(QuorumCertificate.class);
when(committedQc.getView()).thenReturn(View.of(0));
when(highQC.highestCommittedQC()).thenReturn(committedQc);
ViewUpdate initialViewUpdate = ViewUpdate.create(View.of(0), highQC, mock(BFTNode.class), mock(BFTNode.class));
this.pacemaker = new Pacemaker(this.self, this.counters, this.validatorSet, this.vertexStore, this.safetyRules, this.timeoutDispatcher, this.timeoutSender, this.timeoutCalculator, this.nextTxnsGenerator, this.proposalDispatcher, this.voteDispatcher, hasher, timeSupplier, initialViewUpdate, new SystemCountersImpl());
}
use of com.radixdlt.hotstuff.QuorumCertificate in project radixdlt by radixdlt.
the class VerifiedVertexStoreStateCreationTest method creating_vertex_store_with_qc_not_matching_vertex_should_fail.
@Test
public void creating_vertex_store_with_qc_not_matching_vertex_should_fail() {
BFTHeader genesisHeader = new BFTHeader(View.of(0), HashUtils.random256(), mock(LedgerHeader.class));
VoteData voteData = new VoteData(genesisHeader, genesisHeader, genesisHeader);
QuorumCertificate badRootQC = new QuorumCertificate(voteData, new TimestampedECDSASignatures());
assertThatThrownBy(() -> VerifiedVertexStoreState.create(HighQC.from(badRootQC), genesisVertex, Optional.empty(), hasher)).isInstanceOf(IllegalStateException.class);
}
use of com.radixdlt.hotstuff.QuorumCertificate in project radixdlt by radixdlt.
the class DifferentTimestampsCauseTimeoutTest method mutateQC.
private QuorumCertificate mutateQC(QuorumCertificate qc, int destination) {
TimestampedECDSASignatures signatures = qc.getTimestampedSignatures();
VoteData voteData = qc.getVoteData();
return new QuorumCertificate(voteData, mutateTimestampedSignatures(signatures, destination));
}
use of com.radixdlt.hotstuff.QuorumCertificate in project radixdlt by radixdlt.
the class DifferentTimestampsCauseTimeoutTest method mutateProposal.
private Proposal mutateProposal(Proposal p, int destination) {
QuorumCertificate committedQC = p.highQC().highestCommittedQC();
UnverifiedVertex vertex = p.getVertex();
ECDSASignature signature = p.getSignature();
return new Proposal(mutateVertex(vertex, destination), committedQC, signature, Optional.empty());
}
Aggregations