Skip to content

Commit a53cd6d

Browse files
committed
improvements
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent dcebcf9 commit a53cd6d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/zkevm/test_worst_compute.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ def test_worst_modexp(
347347
pytest.param(
348348
bls12381_spec.Spec.PAIRING,
349349
[
350-
bls12381_spec.Spec.G1 + bls12381_spec.Spec.INF_G2,
350+
bls12381_spec.Spec.G1,
351+
bls12381_spec.Spec.G2,
351352
],
352353
id="bls12_pairing_check",
353354
),
@@ -372,17 +373,22 @@ def test_worst_precompile_fixed_cost(
372373
pre: Alloc,
373374
fork: Fork,
374375
precompile_address: Address,
375-
parameters: list[str] | list[BytesConcatenation],
376+
parameters: list[str] | list[BytesConcatenation] | list[bytes],
376377
):
377378
"""Test running a block filled with a precompile with fixed cost."""
378379
env = Environment()
379380

380-
concatenated_bytes = bytes()
381-
if isinstance(parameters[0], str):
381+
concatenated_bytes: bytes
382+
if all(isinstance(p, str) for p in parameters):
382383
concatenated_hex_string = "".join(parameters)
383384
concatenated_bytes = bytes.fromhex(concatenated_hex_string)
384-
else:
385+
elif all(isinstance(p, (bytes, BytesConcatenation)) for p in parameters):
385386
concatenated_bytes = b"".join(bytes(p) for p in parameters)
387+
else:
388+
raise TypeError(
389+
"parameters must be a list of strings (hex) "
390+
"or a list of byte-like objects (bytes or BytesConcatenation)."
391+
)
386392

387393
padding_length = (32 - (len(concatenated_bytes) % 32)) % 32
388394
input_bytes = concatenated_bytes + b"\x00" * padding_length

0 commit comments

Comments
 (0)