Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Nov 17, 2023
1 parent 559e40a commit 9eeffd4
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,9 @@ protected SignedBeaconBlock assertBlockUnblinded(
final SignedBeaconBlock blindedBlock, final Spec spec) {
final BlockFactory blockFactory = createBlockFactory(spec);

// no need to configure blobs for just testing block unblinding
BuilderPayload builderPayload = prepareBuilderPayload(spec, 0);

// no need to prepare blobs bundle when only testing block unblinding
when(executionLayer.getUnblindedPayload(blindedBlock))
.thenReturn(SafeFuture.completedFuture(builderPayload));
.thenReturn(SafeFuture.completedFuture(executionPayload));

final SignedBeaconBlock unblindedBlock =
blockFactory.unblindSignedBlockIfBlinded(blindedBlock).join();
Expand Down Expand Up @@ -398,19 +396,19 @@ protected SszList<SszKZGCommitment> prepareBuilderBlobKzgCommitments(

protected BuilderPayload prepareBuilderPayload(final Spec spec, final int blobsCount) {
final DataStructureUtil dataStructureUtil = new DataStructureUtil(spec);
final ExecutionPayload executionPayload =
Optional.ofNullable(this.executionPayload)
.orElseGet(dataStructureUtil::randomExecutionPayload);
final ExecutionPayload builderExecutionPayload =
Optional.ofNullable(executionPayload).orElseGet(dataStructureUtil::randomExecutionPayload);
final BuilderPayload builderPayload;
if (spec.isMilestoneSupported(SpecMilestone.DENEB)) {
final SchemaDefinitionsDeneb schemaDefinitionsDeneb =
SchemaDefinitionsDeneb.required(spec.getGenesisSchemaDefinitions());
builderPayload =
schemaDefinitionsDeneb
.getExecutionPayloadAndBlobsBundleSchema()
.create(executionPayload, dataStructureUtil.randomBuilderBlobsBundle(blobsCount));
.create(
builderExecutionPayload, dataStructureUtil.randomBuilderBlobsBundle(blobsCount));
} else {
builderPayload = executionPayload;
builderPayload = builderExecutionPayload;
}
this.builderPayload = Optional.of(builderPayload);

Expand Down

0 comments on commit 9eeffd4

Please sign in to comment.