use of com.radixdlt.hotstuff.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.hotstuff.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.hotstuff.bft.View in project radixdlt by radixdlt.
the class LedgerProofTest method testGetters.
@Test
public void testGetters() {
LedgerHeader l0 = mock(LedgerHeader.class);
HashCode accumulatorHash = mock(HashCode.class);
View view = mock(View.class);
when(l0.getEpoch()).thenReturn(3L);
AccumulatorState accumulatorState = mock(AccumulatorState.class);
when(accumulatorState.getAccumulatorHash()).thenReturn(accumulatorHash);
when(accumulatorState.getStateVersion()).thenReturn(12345L);
when(l0.getAccumulatorState()).thenReturn(accumulatorState);
when(l0.getView()).thenReturn(view);
when(l0.timestamp()).thenReturn(2468L);
when(l0.isEndOfEpoch()).thenReturn(true);
var ledgerHeaderAndProof = new LedgerProof(HashUtils.random256(), l0, mock(TimestampedECDSASignatures.class));
assertThat(ledgerHeaderAndProof.getEpoch()).isEqualTo(3L);
assertThat(ledgerHeaderAndProof.getStateVersion()).isEqualTo(12345L);
assertThat(ledgerHeaderAndProof.getView()).isEqualTo(view);
assertThat(ledgerHeaderAndProof.timestamp()).isEqualTo(2468L);
assertThat(ledgerHeaderAndProof.isEndOfEpoch()).isTrue();
}
use of com.radixdlt.hotstuff.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.hotstuff.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();
}
Aggregations