Search in sources :

Example 16 with QuorumCertificate

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

Aggregations

QuorumCertificate (com.radixdlt.consensus.QuorumCertificate)16 Test (org.junit.Test)11 BFTHeader (com.radixdlt.consensus.BFTHeader)9 HighQC (com.radixdlt.consensus.HighQC)9 TimestampedECDSASignatures (com.radixdlt.consensus.TimestampedECDSASignatures)8 VoteData (com.radixdlt.consensus.VoteData)8 LedgerHeader (com.radixdlt.consensus.LedgerHeader)7 BFTNode (com.radixdlt.consensus.bft.BFTNode)5 VerifiedVertex (com.radixdlt.consensus.bft.VerifiedVertex)5 ViewUpdate (com.radixdlt.consensus.bft.ViewUpdate)5 Before (org.junit.Before)5 Txn (com.radixdlt.atom.Txn)4 Ledger (com.radixdlt.consensus.Ledger)4 UnverifiedVertex (com.radixdlt.consensus.UnverifiedVertex)4 Vote (com.radixdlt.consensus.Vote)4 View (com.radixdlt.consensus.bft.View)4 EventDispatcher (com.radixdlt.environment.EventDispatcher)4 ImmutableList (com.google.common.collect.ImmutableList)3 HashCode (com.google.common.hash.HashCode)3 Sha256Hasher (com.radixdlt.consensus.Sha256Hasher)3