Skip to content

Commit

Permalink
additional check in AT
Browse files Browse the repository at this point in the history
  • Loading branch information
usmansaleem committed Sep 30, 2024
1 parent f4b752e commit 36dbf34
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import tech.pegasys.teku.api.schema.Attestation;
import tech.pegasys.teku.bls.BLS;
import tech.pegasys.teku.bls.BLSKeyPair;
import tech.pegasys.teku.bls.BLSPublicKey;
Expand Down Expand Up @@ -65,6 +66,13 @@ void signAndVerifyAggregateAndProofV2Signature(final SpecMilestone specMilestone
setupEth2Signer(Eth2Network.MINIMAL, specMilestone);

final Eth2SigningRequestBody request = util.createAggregateAndProofV2Request();
// assert that the Attestation in AggregateAndProofV2 is created correctly for the spec
final Attestation aggregate = request.aggregateAndProofV2().data().aggregate;
if (specMilestone.isGreaterThanOrEqualTo(SpecMilestone.ELECTRA)) {
assertThat(aggregate.committee_bits).isNotNull();
} else {
assertThat(aggregate.committee_bits).isNull();
}
final Response response =
signer.eth2Sign(KEY_PAIR.getPublicKey().toString(), request, ContentType.JSON);
final Bytes signature = verifyAndGetSignatureResponse(response, ContentType.JSON);
Expand Down

0 comments on commit 36dbf34

Please sign in to comment.