Search in sources :

Example 16 with BFTHeader

use of com.radixdlt.consensus.BFTHeader 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

BFTHeader (com.radixdlt.consensus.BFTHeader)16 Test (org.junit.Test)12 HighQC (com.radixdlt.consensus.HighQC)8 Vote (com.radixdlt.consensus.Vote)7 VerifiedVertex (com.radixdlt.consensus.bft.VerifiedVertex)7 QuorumCertificate (com.radixdlt.consensus.QuorumCertificate)6 VoteData (com.radixdlt.consensus.VoteData)6 TimestampedECDSASignatures (com.radixdlt.consensus.TimestampedECDSASignatures)5 View (com.radixdlt.consensus.bft.View)5 LedgerHeader (com.radixdlt.consensus.LedgerHeader)4 Builder (com.radixdlt.consensus.safety.SafetyState.Builder)4 HashCode (com.google.common.hash.HashCode)3 HashSigner (com.radixdlt.consensus.HashSigner)1 Ledger (com.radixdlt.consensus.Ledger)1 BFTInsertUpdate (com.radixdlt.consensus.bft.BFTInsertUpdate)1 BFTNode (com.radixdlt.consensus.bft.BFTNode)1 PreparedVertex (com.radixdlt.consensus.bft.PreparedVertex)1 VerifiedVertexStoreState (com.radixdlt.consensus.bft.VerifiedVertexStoreState)1 ViewUpdate (com.radixdlt.consensus.bft.ViewUpdate)1 Hasher (com.radixdlt.crypto.Hasher)1