Move index check to top

This commit is contained in:
Justin Traglia 2024-10-02 15:55:16 -05:00
parent 09cc20459b
commit e02cbab59f
No known key found for this signature in database
GPG Key ID: F099C9CD25DF82A1
1 changed files with 2 additions and 2 deletions

View File

@ -72,10 +72,10 @@ def verify_data_column_sidecar(sidecar: DataColumnSidecar) -> bool:
"""
Verify if the data column sidecar is valid.
"""
# A sidecar for zero blobs is invalid
assert len(sidecar.kzg_commitments) > 0
# The sidecar index must be within the valid range
assert sidecar.index < NUMBER_OF_COLUMNS
# A sidecar for zero blobs is invalid
assert len(sidecar.kzg_commitments) > 0
# There should be an equal number of cells/commitments/proofs
assert len(sidecar.column) == len(sidecar.kzg_commitments) == len(sidecar.kzg_proofs)