Search in sources :

Example 1 with SyncCommitteeContributionSchema

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();
}
Also used : SchemaDefinitionsAltair(tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair) SyncCommitteeContributionSchema(tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema) SszBitvector(tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector)

Example 2 with SyncCommitteeContributionSchema

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());
}
Also used : SchemaDefinitionsAltair(tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair) SyncCommitteeContributionSchema(tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema) SszBitvector(tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector)

Aggregations

SszBitvector (tech.pegasys.teku.infrastructure.ssz.collections.SszBitvector)2 SyncCommitteeContributionSchema (tech.pegasys.teku.spec.datastructures.operations.versions.altair.SyncCommitteeContributionSchema)2 SchemaDefinitionsAltair (tech.pegasys.teku.spec.schemas.SchemaDefinitionsAltair)2