@@ -347,7 +347,8 @@ def test_worst_modexp(
347
347
pytest .param (
348
348
bls12381_spec .Spec .PAIRING ,
349
349
[
350
- bls12381_spec .Spec .G1 + bls12381_spec .Spec .INF_G2 ,
350
+ bls12381_spec .Spec .G1 ,
351
+ bls12381_spec .Spec .G2 ,
351
352
],
352
353
id = "bls12_pairing_check" ,
353
354
),
@@ -372,17 +373,22 @@ def test_worst_precompile_fixed_cost(
372
373
pre : Alloc ,
373
374
fork : Fork ,
374
375
precompile_address : Address ,
375
- parameters : list [str ] | list [BytesConcatenation ],
376
+ parameters : list [str ] | list [BytesConcatenation ] | list [ bytes ] ,
376
377
):
377
378
"""Test running a block filled with a precompile with fixed cost."""
378
379
env = Environment ()
379
380
380
- concatenated_bytes = bytes ()
381
- if isinstance (parameters [ 0 ] , str ):
381
+ concatenated_bytes : bytes
382
+ if all ( isinstance (p , str ) for p in parameters ):
382
383
concatenated_hex_string = "" .join (parameters )
383
384
concatenated_bytes = bytes .fromhex (concatenated_hex_string )
384
- else :
385
+ elif all ( isinstance ( p , ( bytes , BytesConcatenation )) for p in parameters ) :
385
386
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
+ )
386
392
387
393
padding_length = (32 - (len (concatenated_bytes ) % 32 )) % 32
388
394
input_bytes = concatenated_bytes + b"\x00 " * padding_length
0 commit comments