Search in sources :

Example 11 with VoteData

use of com.radixdlt.hotstuff.VoteData 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);
}
Also used : TimestampedECDSASignatures(com.radixdlt.hotstuff.TimestampedECDSASignatures) BFTHeader(com.radixdlt.hotstuff.BFTHeader) LedgerHeader(com.radixdlt.hotstuff.LedgerHeader) QuorumCertificate(com.radixdlt.hotstuff.QuorumCertificate) VoteData(com.radixdlt.hotstuff.VoteData) Test(org.junit.Test)

Example 12 with VoteData

use of com.radixdlt.hotstuff.VoteData 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));
}
Also used : TimestampedECDSASignatures(com.radixdlt.hotstuff.TimestampedECDSASignatures) QuorumCertificate(com.radixdlt.hotstuff.QuorumCertificate) VoteData(com.radixdlt.hotstuff.VoteData)

Aggregations

VoteData (com.radixdlt.hotstuff.VoteData)12 BFTHeader (com.radixdlt.hotstuff.BFTHeader)10 QuorumCertificate (com.radixdlt.hotstuff.QuorumCertificate)9 TimestampedECDSASignatures (com.radixdlt.hotstuff.TimestampedECDSASignatures)9 LedgerHeader (com.radixdlt.hotstuff.LedgerHeader)7 View (com.radixdlt.hotstuff.bft.View)4 HashCode (com.google.common.hash.HashCode)3 Test (org.junit.Test)3 Vote (com.radixdlt.hotstuff.Vote)2 BFTNode (com.radixdlt.hotstuff.bft.BFTNode)2 ECDSASignature (com.radixdlt.crypto.ECDSASignature)1 EventDispatcher (com.radixdlt.environment.EventDispatcher)1 HighQC (com.radixdlt.hotstuff.HighQC)1 Ledger (com.radixdlt.hotstuff.Ledger)1 Proposal (com.radixdlt.hotstuff.Proposal)1 UnverifiedVertex (com.radixdlt.hotstuff.UnverifiedVertex)1 VerifiedVertex (com.radixdlt.hotstuff.bft.VerifiedVertex)1 AccumulatorState (com.radixdlt.ledger.AccumulatorState)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Before (org.junit.Before)1