use of com.radixdlt.consensus.bft.View in project radixdlt by radixdlt.
the class UnverifiedVertexTest method setUp.
@Before
public void setUp() {
View baseView = View.of(1234567890L);
HashCode id = HashUtils.random256();
BFTHeader header = new BFTHeader(baseView.next(), id, mock(LedgerHeader.class));
BFTHeader parent = new BFTHeader(baseView, HashUtils.random256(), mock(LedgerHeader.class));
VoteData voteData = new VoteData(header, parent, parent);
this.qc = new QuorumCertificate(voteData, new TimestampedECDSASignatures());
this.testObject = UnverifiedVertex.create(this.qc, baseView.next().next(), List.of(), BFTNode.random());
}
use of com.radixdlt.consensus.bft.View in project radixdlt by radixdlt.
the class BFTHeaderTest method setUp.
@Before
public void setUp() {
View view = View.of(1234567890L);
this.id = HashUtils.random256();
this.ledgerHeader = mock(LedgerHeader.class);
this.testObject = new BFTHeader(view, id, ledgerHeader);
}
use of com.radixdlt.consensus.bft.View in project radixdlt by radixdlt.
the class EpochViewTest method testToString.
@Test
public void testToString() {
View view = mock(View.class);
EpochView epochView = EpochView.of(12345L, view);
assertThat(epochView.toString()).isNotNull();
}
use of com.radixdlt.consensus.bft.View in project radixdlt by radixdlt.
the class EpochViewTest method testGetters.
@Test
public void testGetters() {
View view = mock(View.class);
EpochView epochView = EpochView.of(12345L, view);
assertThat(epochView.getEpoch()).isEqualTo(12345L);
assertThat(epochView.getView()).isEqualTo(view);
}
use of com.radixdlt.consensus.bft.View in project radixdlt by radixdlt.
the class PacemakerStateTest method when_process_qc_for_wrong_view__then_ignored.
@Test
public void when_process_qc_for_wrong_view__then_ignored() {
HighQC highQC = mock(HighQC.class);
when(highQC.getHighestView()).thenReturn(View.of(1));
// Move ahead for a bit so we can send in a QC for a lower view
this.pacemakerState.processQC(highQCFor(View.of(0)));
this.pacemakerState.processQC(highQCFor(View.of(1)));
this.pacemakerState.processQC(highQCFor(View.of(2)));
verify(viewUpdateSender, times(1)).dispatch(argThat(v -> v.getCurrentView().equals(View.of(1))));
verify(viewUpdateSender, times(1)).dispatch(argThat(v -> v.getCurrentView().equals(View.of(2))));
verify(viewUpdateSender, times(1)).dispatch(argThat(v -> v.getCurrentView().equals(View.of(3))));
this.pacemakerState.processQC(highQC);
verifyNoMoreInteractions(viewUpdateSender);
}
Aggregations