@@ -263,8 +263,11 @@ def write_to_file(self):
263
263
264
264
def verify_cell_kzg_proof_batch (self , cell_indices : list ) -> bool :
265
265
"""Check whether all cell proofs are valid and returns True only if that is the case."""
266
- assert self .fork in ["osaka" ], (
267
- f"verify_cell_kzg_proof_batch() is not available for fork: { self .fork } "
266
+ fork_obj = fork_string_to_object (self .fork )
267
+ amount_cell_proofs : int = cast (int , fork_obj .get_blob_constant ("AMOUNT_CELL_PROOFS" ))
268
+
269
+ assert amount_cell_proofs > 0 , (
270
+ f"verify_cell_kzg_proof_batch() is not available for your fork: { self .fork } ."
268
271
)
269
272
270
273
assert self .cells is not None , "self.cells is None, critical error."
@@ -294,7 +297,10 @@ def delete_cells_then_recover_them(self, deletion_indices: list[int]):
294
297
the ckzg recovery mechanism is used to repair the missing cells.
295
298
If no assertion is triggered the reconstruction was successful.
296
299
"""
297
- assert self .fork in ["osaka" ], (
300
+ fork_obj = fork_string_to_object (self .fork )
301
+ amount_cell_proofs : int = cast (int , fork_obj .get_blob_constant ("AMOUNT_CELL_PROOFS" ))
302
+
303
+ assert amount_cell_proofs > 0 , (
298
304
f"delete_cells_then_recover_them() is not available for fork: { self .fork } "
299
305
)
300
306
@@ -370,7 +376,9 @@ def corrupt_byte(b: bytes) -> Bytes:
370
376
return Bytes (bytes ([b [0 ] ^ 0xFF ]))
371
377
372
378
# osaka and later
373
- if self .fork in ["osaka" ]:
379
+ fork_obj = fork_string_to_object (self .fork )
380
+ amount_cell_proofs : int = cast (int , fork_obj .get_blob_constant ("AMOUNT_CELL_PROOFS" ))
381
+ if amount_cell_proofs > 0 :
374
382
assert isinstance (self .proof , list ), (
375
383
"proof was expected to be a list but it isn't"
376
384
) # make mypy happy
@@ -396,7 +404,7 @@ def corrupt_byte(b: bytes) -> Bytes:
396
404
return
397
405
398
406
# pre-osaka (cancun and prague)
399
- assert self . fork in [ "cancun" , "prague" ] , (
407
+ assert amount_cell_proofs == 0 , (
400
408
f"You need to adjust corrupt_proof to handle fork { self .fork } "
401
409
)
402
410
assert isinstance (self .proof , Bytes ), "proof was expected to be Bytes but it isn't"
0 commit comments