Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve isDataAvailable checks #7575

Merged
merged 14 commits into from
Oct 17, 2023
Prev Previous commit
Next Next commit
comment and CodeQL
  • Loading branch information
tbenr committed Oct 10, 2023
commit bedcf746778a1b2c98e4b81d7da3beca7bd02489
Original file line number Diff line number Diff line change
@@ -97,7 +97,8 @@ public VersionedHash kzgCommitmentToVersionedHash(final KZGCommitment kzgCommitm
*
* @param blobSidecars blob sidecars to validate
* @param block block to validate blob sidecar against
* @param kzgCommitmentsFromBlock kzg commitments from block
* @param kzgCommitmentsFromBlock kzg commitments from block. They could be extracted from block
* but since we already have them we can avoid extracting them again.
*/
@Override
public void validateBlobSidecarsAgainstBlock(
Original file line number Diff line number Diff line change
@@ -86,15 +86,15 @@ void validateBlobSidecarsAgainstBlock_shouldThrowOnBlobSidecarNotMatching(
// make sure we are testing something
assertThat(kzgCommitments).isNotEmpty();

final Integer indexToBeAltered =
final int indexToBeAltered =
Math.toIntExact(dataStructureUtil.randomPositiveLong(kzgCommitments.size()));

// let's create blobs with only one altered with the given alteration
final List<BlobSidecar> blobSidecars =
dataStructureUtil.randomBlobSidecarsForBlock(
block,
(index, randomBlobSidecarBuilder) -> {
if (!indexToBeAltered.equals(index)) {
if (!index.equals(indexToBeAltered)) {
return randomBlobSidecarBuilder;
}