use of tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodyAltair in project teku by ConsenSys.
the class SyncCommitteePerformanceTrackerTest method withSyncAggregate.
private void withSyncAggregate(final int slot, final Integer... includedCommitteeIndices) {
final SignedBeaconBlock signedBlock = mock(SignedBeaconBlock.class);
final BeaconBlock block = mock(BeaconBlock.class);
final BeaconBlockBodyAltair blockBody = mock(BeaconBlockBodyAltair.class);
final SyncAggregate syncAggregate = ((BeaconBlockBodySchemaAltair) schemaDefinitionsAltair.getBeaconBlockBodySchema()).getSyncAggregateSchema().create(List.of(includedCommitteeIndices), BLSSignature.empty());
when(signedBlock.getMessage()).thenReturn(block);
when(block.getBody()).thenReturn(blockBody);
when(blockBody.toVersionAltair()).thenReturn(Optional.of(blockBody));
when(blockBody.getSyncAggregate()).thenReturn(syncAggregate);
when(combinedChainDataClient.getBlockAtSlotExact(UInt64.valueOf(slot))).thenReturn(SafeFuture.completedFuture(Optional.of(signedBlock)));
}
use of tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.altair.BeaconBlockBodyAltair in project teku by ConsenSys.
the class BlockProcessorAltair method processBlock.
@Override
public void processBlock(final MutableBeaconState genericState, final BeaconBlock block, final IndexedAttestationCache indexedAttestationCache, final BLSSignatureVerifier signatureVerifier, final OptimisticExecutionPayloadExecutor payloadExecutor) throws BlockProcessingException {
final MutableBeaconStateAltair state = MutableBeaconStateAltair.required(genericState);
final BeaconBlockBodyAltair blockBody = BeaconBlockBodyAltair.required(block.getBody());
super.processBlock(state, block, indexedAttestationCache, signatureVerifier, payloadExecutor);
processSyncAggregate(state, blockBody.getSyncAggregate(), signatureVerifier);
}
Aggregations