Skip to content

Commit 0ca4a6a

Browse files
committed
tests: fix eip2537 ruff changes.
1 parent b6b2df6 commit 0ca4a6a

12 files changed

+37
-36
lines changed

tests/prague/eip2537_bls_12_381_precompiles/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212

1313
@pytest.fixture
14-
def precompile_gas(precompile_address: int, input_value: bytes) -> int:
14+
def precompile_gas(precompile_address: int, input_data: bytes) -> int:
1515
"""Gas cost for the precompile."""
16-
return GAS_CALCULATION_FUNCTION_MAP[precompile_address](len(input_value))
16+
return GAS_CALCULATION_FUNCTION_MAP[precompile_address](len(input_data))
1717

1818

1919
@pytest.fixture

tests/prague/eip2537_bls_12_381_precompiles/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Helper functions for the EIP-2537 BLS12-381 precompiles tests."""
2+
23
import os
34
from typing import Annotated, List
45

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1add.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
@pytest.mark.parametrize(
24-
"input_value,expected_output",
24+
"input_data,expected_output",
2525
vectors_from_file("add_G1_bls.json")
2626
+ [
2727
pytest.param(
@@ -57,7 +57,7 @@ def test_valid(
5757

5858

5959
@pytest.mark.parametrize(
60-
"input_value",
60+
"input_data",
6161
vectors_from_file("fail-add_G1_bls.json")
6262
+ [
6363
pytest.param(
@@ -163,7 +163,7 @@ def test_invalid(
163163

164164

165165
@pytest.mark.parametrize(
166-
"input_value,expected_output,precompile_gas_modifier",
166+
"input_data,expected_output,precompile_gas_modifier",
167167
[
168168
pytest.param(
169169
Spec.INF_G1 + Spec.INF_G1,
@@ -203,7 +203,7 @@ def test_gas(
203203
],
204204
)
205205
@pytest.mark.parametrize(
206-
"input_value,expected_output",
206+
"input_data,expected_output",
207207
[
208208
pytest.param(
209209
Spec.INF_G1 + Spec.INF_G1,

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1msm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
@pytest.mark.parametrize(
24-
"input_value,expected_output",
24+
"input_data,expected_output",
2525
vectors_from_file("multiexp_G1_bls.json")
2626
+ [
2727
pytest.param(
@@ -52,7 +52,7 @@ def test_valid(
5252

5353

5454
@pytest.mark.parametrize(
55-
"input_value",
55+
"input_data",
5656
vectors_from_file("fail-multiexp_G1_bls.json")
5757
+ [
5858
pytest.param(
@@ -122,7 +122,7 @@ def test_invalid(
122122
],
123123
)
124124
@pytest.mark.parametrize(
125-
"input_value,expected_output",
125+
"input_data,expected_output",
126126
[
127127
pytest.param(
128128
Spec.INF_G1 + Scalar(0),

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1mul.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
@pytest.mark.parametrize(
24-
"input_value,expected_output",
24+
"input_data,expected_output",
2525
vectors_from_file("mul_G1_bls.json")
2626
+ [
2727
pytest.param(
@@ -85,7 +85,7 @@ def test_valid(
8585

8686

8787
@pytest.mark.parametrize(
88-
"input_value",
88+
"input_data",
8989
vectors_from_file("fail-mul_G1_bls.json")
9090
+ [
9191
pytest.param(
@@ -167,7 +167,7 @@ def test_invalid(
167167

168168

169169
@pytest.mark.parametrize(
170-
"input_value,expected_output,precompile_gas_modifier",
170+
"input_data,expected_output,precompile_gas_modifier",
171171
[
172172
pytest.param(
173173
Spec.INF_G1 + Scalar(0),
@@ -207,7 +207,7 @@ def test_gas(
207207
],
208208
)
209209
@pytest.mark.parametrize(
210-
"input_value,expected_output",
210+
"input_data,expected_output",
211211
[
212212
pytest.param(
213213
Spec.INF_G1 + Scalar(0),

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g2add.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
@pytest.mark.parametrize(
24-
"input_value,expected_output",
24+
"input_data,expected_output",
2525
vectors_from_file("add_G2_bls.json")
2626
+ [
2727
pytest.param(
@@ -47,7 +47,7 @@ def test_valid(
4747

4848

4949
@pytest.mark.parametrize(
50-
"input_value",
50+
"input_data",
5151
vectors_from_file("fail-add_G2_bls.json")
5252
+ [
5353
pytest.param(
@@ -169,7 +169,7 @@ def test_invalid(
169169

170170

171171
@pytest.mark.parametrize(
172-
"input_value,expected_output,precompile_gas_modifier",
172+
"input_data,expected_output,precompile_gas_modifier",
173173
[
174174
pytest.param(
175175
Spec.INF_G2 + Spec.INF_G2,
@@ -209,7 +209,7 @@ def test_gas(
209209
],
210210
)
211211
@pytest.mark.parametrize(
212-
"input_value,expected_output",
212+
"input_data,expected_output",
213213
[
214214
pytest.param(
215215
Spec.INF_G2 + Spec.INF_G2,

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g2msm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
]
2121

2222

23-
@pytest.mark.parametrize("input_value,expected_output", vectors_from_file("multiexp_G2_bls.json"))
23+
@pytest.mark.parametrize("input_data,expected_output", vectors_from_file("multiexp_G2_bls.json"))
2424
def test_valid(
2525
state_test: StateTestFiller,
2626
pre: Alloc,
@@ -37,7 +37,7 @@ def test_valid(
3737

3838

3939
@pytest.mark.parametrize(
40-
"input_value",
40+
"input_data",
4141
vectors_from_file("fail-multiexp_G2_bls.json")
4242
+ [
4343
pytest.param(
@@ -112,7 +112,7 @@ def test_invalid(
112112
],
113113
)
114114
@pytest.mark.parametrize(
115-
"input_value,expected_output",
115+
"input_data,expected_output",
116116
[
117117
pytest.param(
118118
Spec.INF_G2 + Scalar(0),

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g2mul.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
@pytest.mark.parametrize(
24-
"input_value,expected_output",
24+
"input_data,expected_output",
2525
vectors_from_file("mul_G2_bls.json")
2626
+ [
2727
pytest.param(
@@ -96,7 +96,7 @@ def test_valid(
9696

9797

9898
@pytest.mark.parametrize(
99-
"input_value",
99+
"input_data",
100100
vectors_from_file("fail-mul_G2_bls.json")
101101
+ [
102102
pytest.param(
@@ -190,7 +190,7 @@ def test_invalid(
190190

191191

192192
@pytest.mark.parametrize(
193-
"input_value,expected_output,precompile_gas_modifier",
193+
"input_data,expected_output,precompile_gas_modifier",
194194
[
195195
pytest.param(
196196
Spec.INF_G2 + Scalar(0),
@@ -230,7 +230,7 @@ def test_gas(
230230
],
231231
)
232232
@pytest.mark.parametrize(
233-
"input_value,expected_output",
233+
"input_data,expected_output",
234234
[
235235
pytest.param(
236236
Spec.INF_G2 + Scalar(0),

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp2_to_g2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
@pytest.mark.parametrize(
35-
"input_value,expected_output",
35+
"input_data,expected_output",
3636
vectors_from_file("map_fp2_to_G2_bls.json")
3737
+ [
3838
pytest.param(
@@ -72,7 +72,7 @@ def test_valid(
7272

7373

7474
@pytest.mark.parametrize(
75-
"input_value",
75+
"input_data",
7676
vectors_from_file("fail-map_fp2_to_G2_bls.json")
7777
+ [
7878
pytest.param(b"\x80" + bytes(FP2((0, 0)))[1:], id="invalid_encoding"),
@@ -103,7 +103,7 @@ def test_invalid(
103103

104104

105105
@pytest.mark.parametrize(
106-
"input_value,expected_output,precompile_gas_modifier",
106+
"input_data,expected_output,precompile_gas_modifier",
107107
[
108108
pytest.param(
109109
FP2((0, 0)),
@@ -143,7 +143,7 @@ def test_gas(
143143
],
144144
)
145145
@pytest.mark.parametrize(
146-
"input_value,expected_output",
146+
"input_data,expected_output",
147147
[
148148
pytest.param(
149149
FP2((0, 0)),

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp_to_g1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
@pytest.mark.parametrize(
29-
"input_value,expected_output",
29+
"input_data,expected_output",
3030
vectors_from_file("map_fp_to_G1_bls.json")
3131
+ [
3232
pytest.param(
@@ -60,7 +60,7 @@ def test_valid(
6060

6161

6262
@pytest.mark.parametrize(
63-
"input_value",
63+
"input_data",
6464
vectors_from_file("fail-map_fp_to_G1_bls.json")
6565
+ [
6666
pytest.param(b"\x80" + bytes(FP(0))[1:], id="invalid_encoding"),
@@ -89,7 +89,7 @@ def test_invalid(
8989

9090

9191
@pytest.mark.parametrize(
92-
"input_value,expected_output,precompile_gas_modifier",
92+
"input_data,expected_output,precompile_gas_modifier",
9393
[
9494
pytest.param(
9595
FP(0),
@@ -129,7 +129,7 @@ def test_gas(
129129
],
130130
)
131131
@pytest.mark.parametrize(
132-
"input_value,expected_output",
132+
"input_data,expected_output",
133133
[
134134
pytest.param(
135135
FP(0),

0 commit comments

Comments
 (0)