use of tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema in project teku by ConsenSys.
the class ValidatorDataProvider method getAggregationBits.
private IntIterable getAggregationBits(final Bytes aggregationBits, final UInt64 slot) {
final SchemaDefinitionsAltair altairDefinitions = SchemaDefinitionsAltair.required(spec.atSlot(slot).getSchemaDefinitions());
final SyncCommitteeContributionSchema syncCommitteeContributionSchema = altairDefinitions.getSyncCommitteeContributionSchema();
final SszBitvector aggregationBitsVector = syncCommitteeContributionSchema.getAggregationBitsSchema().fromBytes(aggregationBits);
return aggregationBitsVector.getAllSetBits();
}
use of tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema in project teku by ConsenSys.
the class SyncCommitteeContribution method asInternalSyncCommitteeContribution.
public static tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContribution asInternalSyncCommitteeContribution(final Spec spec, final SyncCommitteeContribution syncCommitteeContribution) {
final SchemaDefinitionsAltair altairDefinitions = SchemaDefinitionsAltair.required(spec.atSlot(syncCommitteeContribution.slot).getSchemaDefinitions());
final SyncCommitteeContributionSchema syncCommitteeContributionSchema = altairDefinitions.getSyncCommitteeContributionSchema();
final SszBitvector aggregationBitsVector = syncCommitteeContributionSchema.getAggregationBitsSchema().fromBytes(syncCommitteeContribution.aggregationBits);
return spec.getSyncCommitteeUtilRequired(syncCommitteeContribution.slot).createSyncCommitteeContribution(syncCommitteeContribution.slot, syncCommitteeContribution.beaconBlockRoot, syncCommitteeContribution.subcommitteeIndex, aggregationBitsVector.getAllSetBits(), syncCommitteeContribution.signature.asInternalBLSSignature());
}
Aggregations