Skip to content

Commit

Permalink
as per feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Oct 23, 2023
1 parent 9472a3a commit 6fbc8b9
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import tech.pegasys.teku.statetransition.blobs.BlobSidecarManager;
import tech.pegasys.teku.statetransition.validation.InternalValidationResult;

/** Simplified version of {@link BlobSidecarManager} which is used in reference tests */
/** Simplified version of {@link BlobSidecarManager} which is used in fork choice reference tests */
class StubBlobSidecarManager implements BlobSidecarManager {

private final Map<Bytes32, BlobsAndProofs> blobsAndProofsByBlockRoot = new HashMap<>();
Expand All @@ -57,7 +57,7 @@ public void prepareBlobsAndProofsForBlock(
public SafeFuture<InternalValidationResult> validateAndPrepareForBlockImport(
final SignedBlobSidecar signedBlobSidecar) {
return SafeFuture.failedFuture(
new UnsupportedOperationException("Not available in fork_choice reference tests"));
new UnsupportedOperationException("Not available in fork choice reference tests"));
}

@Override
Expand Down Expand Up @@ -96,16 +96,16 @@ public SafeFuture<BlobSidecarsAndValidationResult> getAvailabilityCheckResult()
if (blobsAndProofs == null) {
return SafeFuture.completedFuture(BlobSidecarsAndValidationResult.NOT_REQUIRED);
}
return SafeFuture.completedFuture(validateBatch(block, blobsAndProofs));
return SafeFuture.completedFuture(validateImmediately(block, blobsAndProofs));
}

@Override
public BlobSidecarsAndValidationResult validateImmediately(
final List<BlobSidecar> blobSidecars) {
throw new UnsupportedOperationException("Not available in fork_choice reference tests");
throw new UnsupportedOperationException("Not available in fork choice reference tests");
}

public BlobSidecarsAndValidationResult validateBatch(
private BlobSidecarsAndValidationResult validateImmediately(
final SignedBeaconBlock block, final BlobsAndProofs blobsAndProofs) {
final List<KZGCommitment> kzgCommitments =
BeaconBlockBodyDeneb.required(block.getMessage().getBody())
Expand All @@ -131,7 +131,7 @@ public BlobSidecarsAndValidationResult validateBatch(
@Override
public BlobSidecarsAndValidationResult createAvailabilityCheckerAndValidateImmediately(
final SignedBeaconBlock block, final List<BlobSidecar> blobSidecars) {
throw new UnsupportedOperationException("Not available in fork_choice reference tests");
throw new UnsupportedOperationException("Not available in fork choice reference tests");
}

private record BlobsAndProofs(List<Blob> blobs, List<KZGProof> proofs) {}
Expand Down

0 comments on commit 6fbc8b9

Please sign in to comment.