Search in sources :

Example 1 with TimeoutCertificate

use of com.radixdlt.consensus.TimeoutCertificate in project radixdlt by radixdlt.

the class VertexStoreTest method inserting_a_tc_should_only_replace_tcs_for_lower_views.

@Test
public void inserting_a_tc_should_only_replace_tcs_for_lower_views() {
    TimeoutCertificate initialTC = new TimeoutCertificate(1, View.of(100), mock(TimestampedECDSASignatures.class));
    TimeoutCertificate higherTC = new TimeoutCertificate(1, View.of(101), mock(TimestampedECDSASignatures.class));
    sut.insertTimeoutCertificate(initialTC);
    assertEquals(initialTC, sut.getHighestTimeoutCertificate().orElse(null));
    sut.insertTimeoutCertificate(higherTC);
    assertEquals(higherTC, sut.getHighestTimeoutCertificate().orElse(null));
    sut.insertTimeoutCertificate(initialTC);
    assertEquals(higherTC, sut.getHighestTimeoutCertificate().orElse(null));
}
Also used : TimestampedECDSASignatures(com.radixdlt.consensus.TimestampedECDSASignatures) TimeoutCertificate(com.radixdlt.consensus.TimeoutCertificate) Test(org.junit.Test)

Aggregations

TimeoutCertificate (com.radixdlt.consensus.TimeoutCertificate)1 TimestampedECDSASignatures (com.radixdlt.consensus.TimestampedECDSASignatures)1 Test (org.junit.Test)1