use of tech.pegasys.teku.api.schema.altair.SignedContributionAndProof in project teku by ConsenSys.
the class EventSubscriptionManager method onSyncCommitteeContribution.
protected void onSyncCommitteeContribution(final tech.pegasys.teku.spec.datastructures.operations.versions.altair.SignedContributionAndProof proof, final InternalValidationResult result) {
if (result.isAccept()) {
final SignedContributionAndProof signedContributionAndProof = new SignedContributionAndProof(proof);
notifySubscribersOfEvent(EventType.contribution_and_proof, signedContributionAndProof);
}
}
use of tech.pegasys.teku.api.schema.altair.SignedContributionAndProof in project teku by ConsenSys.
the class ValidatorDataProvider method asInternalContributionAndProofs.
private tech.pegasys.teku.spec.datastructures.operations.versions.altair.SignedContributionAndProof asInternalContributionAndProofs(final SignedContributionAndProof signedContributionAndProof) {
final UInt64 slot = signedContributionAndProof.message.contribution.slot;
final Bytes32 root = signedContributionAndProof.message.contribution.beaconBlockRoot;
final UInt64 subcommitteeIndex = signedContributionAndProof.message.contribution.subcommitteeIndex;
final IntIterable indices = getAggregationBits(signedContributionAndProof.message.contribution.aggregationBits, slot);
final tech.pegasys.teku.bls.BLSSignature signature = signedContributionAndProof.message.contribution.signature.asInternalBLSSignature();
final SyncCommitteeContribution contribution = spec.getSyncCommitteeUtilRequired(slot).createSyncCommitteeContribution(slot, root, subcommitteeIndex, indices, signature);
final ContributionAndProof message = spec.getSyncCommitteeUtilRequired(slot).createContributionAndProof(signedContributionAndProof.message.aggregatorIndex, contribution, signedContributionAndProof.message.selectionProof.asInternalBLSSignature());
return spec.getSyncCommitteeUtilRequired(slot).createSignedContributionAndProof(message, signedContributionAndProof.signature.asInternalBLSSignature());
}
Aggregations