|
29 | 29 | from eth2spec.utils import bls |
30 | 30 |
|
31 | 31 |
|
32 | | -############################################################################### |
33 | | -# Test cases for compute_cells |
34 | | -############################################################################### |
35 | | - |
36 | | -def case01_compute_cells(): |
37 | | - # Valid cases |
38 | | - for blob in VALID_BLOBS: |
39 | | - cells = spec.compute_cells(blob) |
40 | | - identifier = make_id(blob) |
41 | | - yield f'compute_cells_case_valid_{identifier}', { |
42 | | - 'input': { |
43 | | - 'blob': encode_hex(blob), |
44 | | - }, |
45 | | - 'output': encode_hex_list(cells) |
46 | | - } |
47 | | - |
48 | | - # Edge case: Invalid blobs |
49 | | - for blob in INVALID_BLOBS: |
50 | | - expect_exception(spec.compute_cells, blob) |
51 | | - identifier = make_id(blob) |
52 | | - yield f'compute_cells_case_invalid_blob_{identifier}', { |
53 | | - 'input': { |
54 | | - 'blob': encode_hex(blob) |
55 | | - }, |
56 | | - 'output': None |
57 | | - } |
58 | | - |
59 | | - |
60 | 32 | ############################################################################### |
61 | 33 | # Test cases for compute_cells_and_kzg_proofs |
62 | 34 | ############################################################################### |
63 | 35 |
|
64 | | -def case02_compute_cells_and_kzg_proofs(): |
| 36 | +def case_compute_cells_and_kzg_proofs(): |
65 | 37 | # Valid cases |
66 | 38 | for blob in VALID_BLOBS: |
67 | 39 | cells, proofs = spec.compute_cells_and_kzg_proofs(blob) |
@@ -91,7 +63,7 @@ def case02_compute_cells_and_kzg_proofs(): |
91 | 63 | # Test cases for verify_cell_kzg_proof |
92 | 64 | ############################################################################### |
93 | 65 |
|
94 | | -def case03_verify_cell_kzg_proof(): |
| 66 | +def case_verify_cell_kzg_proof(): |
95 | 67 | # Valid cases |
96 | 68 | for i in range(len(VALID_BLOBS)): |
97 | 69 | cells, proofs = VALID_CELLS_AND_PROOFS[i] |
@@ -245,7 +217,7 @@ def case03_verify_cell_kzg_proof(): |
245 | 217 | # Test cases for verify_cell_kzg_proof_batch |
246 | 218 | ############################################################################### |
247 | 219 |
|
248 | | -def case04_verify_cell_kzg_proof_batch(): |
| 220 | +def case_verify_cell_kzg_proof_batch(): |
249 | 221 | # Valid cases |
250 | 222 | for i in range(len(VALID_BLOBS)): |
251 | 223 | cells, proofs = VALID_CELLS_AND_PROOFS[i] |
@@ -617,7 +589,7 @@ def case04_verify_cell_kzg_proof_batch(): |
617 | 589 | # Test cases for recover_cells_and_kzg_proofs |
618 | 590 | ############################################################################### |
619 | 591 |
|
620 | | -def case05_recover_cells_and_kzg_proofs(): |
| 592 | +def case_recover_cells_and_kzg_proofs(): |
621 | 593 | # Valid: No missing cells |
622 | 594 | cells, proofs = VALID_CELLS_AND_PROOFS[0] |
623 | 595 | cell_indices = list(range(spec.CELLS_PER_EXT_BLOB)) |
@@ -899,9 +871,8 @@ def cases_fn() -> Iterable[gen_typing.TestCase]: |
899 | 871 | bls.use_arkworks() |
900 | 872 | gen_runner.run_generator("kzg_7594", [ |
901 | 873 | # EIP-7594 |
902 | | - create_provider(EIP7594, 'compute_cells', case01_compute_cells), |
903 | | - create_provider(EIP7594, 'compute_cells_and_kzg_proofs', case02_compute_cells_and_kzg_proofs), |
904 | | - create_provider(EIP7594, 'verify_cell_kzg_proof', case03_verify_cell_kzg_proof), |
905 | | - create_provider(EIP7594, 'verify_cell_kzg_proof_batch', case04_verify_cell_kzg_proof_batch), |
906 | | - create_provider(EIP7594, 'recover_cells_and_kzg_proofs', case05_recover_cells_and_kzg_proofs), |
| 874 | + create_provider(EIP7594, 'compute_cells_and_kzg_proofs', case_compute_cells_and_kzg_proofs), |
| 875 | + create_provider(EIP7594, 'verify_cell_kzg_proof', case_verify_cell_kzg_proof), |
| 876 | + create_provider(EIP7594, 'verify_cell_kzg_proof_batch', case_verify_cell_kzg_proof_batch), |
| 877 | + create_provider(EIP7594, 'recover_cells_and_kzg_proofs', case_recover_cells_and_kzg_proofs), |
907 | 878 | ]) |
0 commit comments