|
2 | 2 | KZG test vectors generator for EIP-7594
|
3 | 3 | """
|
4 | 4 |
|
| 5 | +import random |
5 | 6 | from collections.abc import Iterable
|
6 | 7 | from functools import cache
|
7 | 8 |
|
@@ -494,6 +495,38 @@ def get_inputs():
|
494 | 495 | get_test_runner(get_inputs),
|
495 | 496 | )
|
496 | 497 |
|
| 498 | + # Valid: Shuffled indices, no missing cells |
| 499 | + if True: |
| 500 | + |
| 501 | + def get_inputs(): |
| 502 | + cells, _ = cached_compute_cells_and_kzg_proofs(VALID_BLOBS[4]) |
| 503 | + cell_indices = list(range(spec.CELLS_PER_EXT_BLOB)) |
| 504 | + random.seed(42) # Use fixed seed for reproducibility |
| 505 | + random.shuffle(cell_indices) |
| 506 | + partial_cells = [cells[cell_index] for cell_index in cell_indices] |
| 507 | + return cell_indices, partial_cells |
| 508 | + |
| 509 | + yield ( |
| 510 | + "recover_cells_and_kzg_proofs_case_valid_shuffled_no_missing", |
| 511 | + get_test_runner(get_inputs), |
| 512 | + ) |
| 513 | + |
| 514 | + # Valid: Shuffled indices, one missing |
| 515 | + if True: |
| 516 | + |
| 517 | + def get_inputs(): |
| 518 | + cells, _ = cached_compute_cells_and_kzg_proofs(VALID_BLOBS[5]) |
| 519 | + cell_indices = list(range(spec.CELLS_PER_EXT_BLOB - 1)) |
| 520 | + random.seed(42) # Use fixed seed for reproducibility |
| 521 | + random.shuffle(cell_indices) |
| 522 | + partial_cells = [cells[cell_index] for cell_index in cell_indices] |
| 523 | + return cell_indices, partial_cells |
| 524 | + |
| 525 | + yield ( |
| 526 | + "recover_cells_and_kzg_proofs_case_valid_shuffled_one_missing", |
| 527 | + get_test_runner(get_inputs), |
| 528 | + ) |
| 529 | + |
497 | 530 | # Edge case: All cells are missing
|
498 | 531 | if True:
|
499 | 532 |
|
|
0 commit comments