Merge pull request #3855 from jtraglia/kzg-7594-tests-indentation

Fix indentation for some kzg_7594 tests
This commit is contained in:
Hsiao-Wei Wang 2024-07-25 21:45:24 +09:00 committed by GitHub
commit e9be4e2e3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -264,79 +264,79 @@ def case_verify_cell_kzg_proof_batch():
'output': None
}
# Edge case: Missing a commitment
cells, proofs = VALID_CELLS_AND_PROOFS[0]
cells, proofs = cells[:2], proofs[:2]
# Do not include the second commitment
commitments = [VALID_COMMITMENTS[0]]
cell_indices = list(range(len(cells)))
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_commitment_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a commitment
cells, proofs = VALID_CELLS_AND_PROOFS[0]
cells, proofs = cells[:2], proofs[:2]
# Do not include the second commitment
commitments = [VALID_COMMITMENTS[0]]
cell_indices = list(range(len(cells)))
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_commitment_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a cell index
cells, proofs = VALID_CELLS_AND_PROOFS[2]
cells, proofs = cells[:2], proofs[:2]
commitments = [VALID_COMMITMENTS[2], VALID_COMMITMENTS[2]]
# Leave off one of the cell indices
cell_indices = list(range(len(cells) - 1))
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_cell_index_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a cell index
cells, proofs = VALID_CELLS_AND_PROOFS[2]
cells, proofs = cells[:2], proofs[:2]
commitments = [VALID_COMMITMENTS[2], VALID_COMMITMENTS[2]]
# Leave off one of the cell indices
cell_indices = list(range(len(cells) - 1))
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_cell_index_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a cell
cells, proofs = VALID_CELLS_AND_PROOFS[3]
cells, proofs = cells[:2], proofs[:2]
commitments = [VALID_COMMITMENTS[3], VALID_COMMITMENTS[3]]
cell_indices = list(range(len(cells)))
# Remove the last proof
cells = cells[:-1]
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_cell_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a cell
cells, proofs = VALID_CELLS_AND_PROOFS[3]
cells, proofs = cells[:2], proofs[:2]
commitments = [VALID_COMMITMENTS[3], VALID_COMMITMENTS[3]]
cell_indices = list(range(len(cells)))
# Remove the last proof
cells = cells[:-1]
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_cell_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a proof
cells, proofs = VALID_CELLS_AND_PROOFS[4]
cells, proofs = cells[:2], proofs[:2]
commitments = [VALID_COMMITMENTS[4], VALID_COMMITMENTS[4]]
cell_indices = list(range(len(cells)))
# Remove the last proof
proofs = proofs[:-1]
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_proof_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
# Edge case: Missing a proof
cells, proofs = VALID_CELLS_AND_PROOFS[4]
cells, proofs = cells[:2], proofs[:2]
commitments = [VALID_COMMITMENTS[4], VALID_COMMITMENTS[4]]
cell_indices = list(range(len(cells)))
# Remove the last proof
proofs = proofs[:-1]
expect_exception(spec.verify_cell_kzg_proof_batch, commitments, cell_indices, cells, proofs)
identifier = make_id(commitments, cell_indices, cells, proofs)
yield f'verify_cell_kzg_proof_batch_case_invalid_missing_proof_{identifier}', {
'input': {
'commitments': encode_hex_list(commitments),
'cell_indices': cell_indices,
'cells': encode_hex_list(cells),
'proofs': encode_hex_list(proofs),
},
'output': None
}
###############################################################################