Skip to content

Commit c5043ec

Browse files
LouisTsai-Csiemarioevz
authored andcommitted
refactor(test-benchmark): centralize benchmark helper utilities (#3166)
1 parent 0b1e698 commit c5043ec

32 files changed

Lines changed: 857 additions & 873 deletions

tests/benchmark/compute/instruction/test_arithmetic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
Transaction,
3131
)
3232

33-
from ..helpers import DEFAULT_BINOP_ARGS, make_dup, neg
33+
from tests.benchmark.helper.numeric import (
34+
DEFAULT_BINOP_ARGS,
35+
make_dup,
36+
neg,
37+
)
3438

3539

3640
@pytest.mark.parametrize(

tests/benchmark/compute/instruction/test_bitwise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Transaction,
2828
)
2929

30-
from ..helpers import (
30+
from tests.benchmark.helper.numeric import (
3131
DEFAULT_BINOP_ARGS,
3232
make_dup,
3333
sar,

tests/benchmark/compute/instruction/test_call_context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
Op,
2525
)
2626

27-
from ..helpers import (
28-
ReturnDataStyle,
29-
)
27+
from tests.benchmark.helper.enums import ReturnDataStyle
3028

3129

3230
@pytest.mark.repricing

tests/benchmark/compute/instruction/test_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
compute_create_address,
3131
)
3232

33-
from ..helpers import StorageAction, TransactionResult
33+
from tests.benchmark.helper.enums import StorageAction, TransactionResult
3434

3535

3636
@pytest.mark.repricing(fixed_key=True, fixed_value=True)

tests/benchmark/compute/precompile/test_alt_bn128.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from py_ecc.bn128 import G1, G2, multiply
2222
from py_ecc.fields import bn128_FQ2
2323

24-
from tests.benchmark.compute.helpers import Precompile
24+
from tests.benchmark.helper.precompile import Precompile
2525
from tests.byzantium.eip196_ec_add_mul.spec import (
2626
PointG1,
2727
Scalar,

tests/benchmark/compute/precompile/test_blake2f.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
WhileGas,
1717
)
1818

19+
from tests.benchmark.helper.precompile import Precompile
1920
from tests.istanbul.eip152_blake2.common import Blake2bInput
2021
from tests.istanbul.eip152_blake2.spec import Spec as Blake2bSpec
2122

22-
from ..helpers import Precompile
23-
2423

2524
@pytest.mark.parametrize(
2625
"precompile_address,calldata",

tests/benchmark/compute/precompile/test_bls12_381.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from py_ecc import optimized_bls12_381 as bls_curve
2323

24-
from tests.benchmark.compute.helpers import Precompile
24+
from tests.benchmark.helper.precompile import Precompile
2525
from tests.prague.eip2537_bls_12_381_precompiles import spec as bls12381_spec
2626
from tests.prague.eip2537_bls_12_381_precompiles.spec import (
2727
build_gas_calculation_function_map,

tests/benchmark/compute/precompile/test_ecrecover.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Op,
1010
)
1111

12-
from tests.benchmark.compute.helpers import Precompile
12+
from tests.benchmark.helper.precompile import Precompile
1313
from tests.frontier.precompiles.spec import EcrecoverInput
1414
from tests.frontier.precompiles.spec import Spec as EcrecoverSpec
1515

tests/benchmark/compute/precompile/test_identity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
WhileGas,
1717
)
1818

19-
from tests.benchmark.compute.helpers import (
19+
from tests.benchmark.helper.precompile import (
2020
Precompile,
2121
calculate_optimal_input_length,
2222
)

tests/benchmark/compute/precompile/test_modexp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
)
1818
from execution_testing.forks import Osaka
1919

20+
from tests.benchmark.helper.precompile import Precompile
2021
from tests.byzantium.eip198_modexp_precompile.helpers import ModExpInput
2122
from tests.osaka.eip7883_modexp_gas_increase.spec import Spec, Spec7883
2223

23-
from ..helpers import Precompile
24-
2524

2625
def create_random_modexp_test_case(
2726
test_id: str,

0 commit comments

Comments
 (0)