diff --git a/tests/zkevm/test_worst_compute.py b/tests/zkevm/test_worst_compute.py index ab72a8b6a98..a2a7e26395e 100644 --- a/tests/zkevm/test_worst_compute.py +++ b/tests/zkevm/test_worst_compute.py @@ -34,6 +34,8 @@ from tests.cancun.eip4844_blobs.spec import Spec as BlobsSpec from tests.istanbul.eip152_blake2.common import Blake2bInput from tests.istanbul.eip152_blake2.spec import Spec as Blake2bSpec +from tests.osaka.eip7951_p256verify_precompiles import spec as p256verify_spec +from tests.osaka.eip7951_p256verify_precompiles.spec import FieldElement from tests.prague.eip2537_bls_12_381_precompiles import spec as bls12381_spec from tests.prague.eip2537_bls_12_381_precompiles.spec import BytesConcatenation @@ -680,6 +682,17 @@ def test_worst_modexp(state_test: StateTestFiller, pre: Alloc, fork: Fork): ], id="bls12_fp_to_g2", ), + pytest.param( + p256verify_spec.Spec.P256VERIFY, + [ + p256verify_spec.Spec.H0, + p256verify_spec.Spec.R0, + p256verify_spec.Spec.S0, + p256verify_spec.Spec.X0, + p256verify_spec.Spec.Y0, + ], + id="p256verify", + ), ], ) @pytest.mark.slow() @@ -693,20 +706,23 @@ def test_worst_precompile_fixed_cost( """Test running a block filled with a precompile with fixed cost.""" env = Environment() + if precompile_address not in fork.precompiles(): + pytest.skip("Precompile not enabled") + concatenated_bytes: bytes if all(isinstance(p, str) for p in parameters): parameters_str = cast(list[str], parameters) concatenated_hex_string = "".join(parameters_str) concatenated_bytes = bytes.fromhex(concatenated_hex_string) - elif all(isinstance(p, (bytes, BytesConcatenation)) for p in parameters): + elif all(isinstance(p, (bytes, BytesConcatenation, FieldElement)) for p in parameters): parameters_bytes_list = [ - bytes(p) for p in cast(list[BytesConcatenation | bytes], parameters) + bytes(p) for p in cast(list[BytesConcatenation | bytes | FieldElement], parameters) ] concatenated_bytes = b"".join(parameters_bytes_list) else: raise TypeError( "parameters must be a list of strings (hex) " - "or a list of byte-like objects (bytes or BytesConcatenation)." + "or a list of byte-like objects (bytes, BytesConcatenation or FieldElement)." ) padding_length = (32 - (len(concatenated_bytes) % 32)) % 32