Skip to content

Commit 15c891d

Browse files
refactor(tests): include FieldElement in worst compute test parameter validation
1 parent 51aa9d1 commit 15c891d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/zkevm/test_worst_compute.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from tests.istanbul.eip152_blake2.common import Blake2bInput
3636
from tests.istanbul.eip152_blake2.spec import Spec as Blake2bSpec
3737
from tests.osaka.eip7951_p256verify_precompiles import spec as p256verify_spec
38+
from tests.osaka.eip7951_p256verify_precompiles.spec import FieldElement
3839
from tests.prague.eip2537_bls_12_381_precompiles import spec as bls12381_spec
3940
from tests.prague.eip2537_bls_12_381_precompiles.spec import BytesConcatenation
4041

@@ -710,15 +711,15 @@ def test_worst_precompile_fixed_cost(
710711
parameters_str = cast(list[str], parameters)
711712
concatenated_hex_string = "".join(parameters_str)
712713
concatenated_bytes = bytes.fromhex(concatenated_hex_string)
713-
elif all(isinstance(p, (bytes, BytesConcatenation)) for p in parameters):
714+
elif all(isinstance(p, (bytes, BytesConcatenation, FieldElement)) for p in parameters):
714715
parameters_bytes_list = [
715-
bytes(p) for p in cast(list[BytesConcatenation | bytes], parameters)
716+
bytes(p) for p in cast(list[BytesConcatenation | bytes | FieldElement], parameters)
716717
]
717718
concatenated_bytes = b"".join(parameters_bytes_list)
718719
else:
719720
raise TypeError(
720721
"parameters must be a list of strings (hex) "
721-
"or a list of byte-like objects (bytes or BytesConcatenation)."
722+
"or a list of byte-like objects (bytes, BytesConcatenation or FieldElement)."
722723
)
723724

724725
padding_length = (32 - (len(concatenated_bytes) % 32)) % 32

0 commit comments

Comments
 (0)