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));
}
Aggregations