use of com.radixdlt.hotstuff.LedgerHeader in project radixdlt by radixdlt.
the class MockedLedgerModule method syncedLedger.
@Provides
@Singleton
Ledger syncedLedger(TimeSupplier timeSupplier) {
return new Ledger() {
@Override
public Optional<PreparedVertex> prepare(LinkedList<PreparedVertex> previous, VerifiedVertex vertex) {
final long timestamp = vertex.getQC().getTimestampedSignatures().weightedTimestamp();
final LedgerHeader ledgerHeader = vertex.getParentHeader().getLedgerHeader().updateViewAndTimestamp(vertex.getView(), timestamp);
return Optional.of(vertex.withHeader(ledgerHeader, timeSupplier.currentTime()).andTxns(vertex.getTxns().stream().<PreparedTxn>map(MockPrepared::new).toList(), Map.of()));
}
};
}
use of com.radixdlt.hotstuff.LedgerHeader in project radixdlt by radixdlt.
the class GetVerticesResponseMessageSerializeTest method get.
private static GetVerticesResponseMessage get() {
LedgerHeader ledgerHeader = LedgerHeaderMock.get();
UnverifiedVertex genesisVertex = UnverifiedVertex.createGenesis(ledgerHeader);
return new GetVerticesResponseMessage(ImmutableList.of(genesisVertex));
}
use of com.radixdlt.hotstuff.LedgerHeader in project radixdlt by radixdlt.
the class BFTHeaderSerializeTest method get.
private static BFTHeader get() {
View view = View.of(1234567890L);
LedgerHeader ledgerHeader = LedgerHeaderMock.get();
return new BFTHeader(view, HashUtils.random256(), ledgerHeader);
}
Aggregations