use of com.radixdlt.hotstuff.TimestampedECDSASignatures in project radixdlt by radixdlt.
the class RadixEngineStateComputerTest method committing_epoch_high_views_should_fail.
// TODO: should catch this and log it somewhere as proof of byzantine quorum
@Test
// state not easily obtained where checked in the RadixEngine
@Ignore("FIXME: Reinstate when upper bound on epoch view is in place.")
public void committing_epoch_high_views_should_fail() throws TxBuilderException {
// Arrange
var cmd0 = systemUpdateCommand(10, 1);
var ledgerProof = new LedgerProof(HashUtils.random256(), LedgerHeader.create(0, View.of(11), new AccumulatorState(3, HashUtils.zero256()), 0), new TimestampedECDSASignatures());
var commandsAndProof = VerifiedTxnsAndProof.create(ImmutableList.of(cmd0), ledgerProof);
// Act
// Assert
assertThatThrownBy(() -> sut.commit(commandsAndProof, null)).isInstanceOf(ByzantineQuorumException.class);
}
use of com.radixdlt.hotstuff.TimestampedECDSASignatures in project radixdlt by radixdlt.
the class BerkeleyLedgerEntryStoreTest method storeMetadataWithForks.
private void storeMetadataWithForks(long epoch, ImmutableSet<ForkVotingResult> forkVotingResults) throws RadixEngineException {
final var fakeTx = mock(REProcessedTxn.class);
final var txn = mock(Txn.class);
when(txn.getId()).thenReturn(AID.from(HashUtils.random256().asBytes()));
when(fakeTx.getTxn()).thenReturn(txn);
when(fakeTx.getGroupedStateUpdates()).thenReturn(List.of());
when(txn.getPayload()).thenReturn(HashUtils.random256().asBytes());
final var proof1 = LedgerAndBFTProof.create(new LedgerProof(HashUtils.random256(), LedgerHeader.create(epoch, View.of(0L), new AccumulatorState(epoch, /* using same state version as epoch */
HashCode.fromInt(1)), 0L), new TimestampedECDSASignatures(Map.of()))).withForksVotingResults(forkVotingResults);
sut.transaction(tx -> {
tx.storeTxn(fakeTx);
tx.storeMetadata(proof1);
return null;
});
}
use of com.radixdlt.hotstuff.TimestampedECDSASignatures in project radixdlt by radixdlt.
the class UnverifiedVertexSerializeTest method get.
private static UnverifiedVertex get() {
View view = View.of(1234567891L);
LedgerHeader ledgerHeader = LedgerHeaderMock.get();
BFTHeader header = new BFTHeader(view, HashUtils.random256(), ledgerHeader);
BFTHeader parent = new BFTHeader(View.of(1234567890L), HashUtils.random256(), ledgerHeader);
VoteData voteData = new VoteData(header, parent, null);
QuorumCertificate qc = new QuorumCertificate(voteData, new TimestampedECDSASignatures());
var txn = Txn.create(new byte[] { 0, 1, 2, 3 });
return UnverifiedVertex.create(qc, view, List.of(txn), BFTNode.random());
}
use of com.radixdlt.hotstuff.TimestampedECDSASignatures in project radixdlt by radixdlt.
the class VoteSerializeTest method get.
private static Vote get() {
View view = View.of(1234567891L);
HashCode id = HashUtils.random256();
LedgerHeader ledgerHeader = LedgerHeaderMock.get();
BFTHeader header = new BFTHeader(view, id, ledgerHeader);
BFTHeader parent = new BFTHeader(View.of(1234567890L), HashUtils.random256(), ledgerHeader);
VoteData voteData = new VoteData(header, parent, null);
BFTNode author = BFTNode.create(ECKeyPair.generateNew().getPublicKey());
QuorumCertificate qc = new QuorumCertificate(voteData, new TimestampedECDSASignatures());
HighQC highQC = HighQC.from(qc, qc, Optional.empty());
return new Vote(author, voteData, 123456L, ECDSASignature.zeroSignature(), highQC, Optional.empty());
}
use of com.radixdlt.hotstuff.TimestampedECDSASignatures in project radixdlt by radixdlt.
the class RemoteSyncResponseValidatorSetVerifierTest method setup.
@Before
public void setup() {
this.validatorSet = mock(BFTValidatorSet.class);
this.validatorSetVerifier = new RemoteSyncResponseValidatorSetVerifier(validatorSet);
commandsAndProof = mock(DtoTxnsAndProof.class);
DtoLedgerProof headerAndProof = mock(DtoLedgerProof.class);
TimestampedECDSASignatures signatures = mock(TimestampedECDSASignatures.class);
when(signatures.getSignatures()).thenReturn(ImmutableMap.of());
when(headerAndProof.getSignatures()).thenReturn(signatures);
when(commandsAndProof.getTail()).thenReturn(headerAndProof);
}
Aggregations