Skip to content

Commit 6e7819f

Browse files
refactor: remove valid case from invalid scenario
1 parent bcff881 commit 6e7819f

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

tests/osaka/eip7883_modexp_gas_increase/conftest.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,6 @@ def precompile_gas(
140140
expected_gas = gas_old if fork < Osaka else gas_new
141141
assert calculated_gas == expected_gas, (
142142
f"Calculated gas {calculated_gas} != Vector gas {expected_gas}\n"
143-
f"Lengths: base: {hex(len(vector.input.base))} ({len(vector.input.base)}), "
144-
f"exponent: {hex(len(vector.input.exponent))} ({len(vector.input.exponent)}), "
145-
f"modulus: {hex(len(vector.input.modulus))} ({len(vector.input.modulus)})\n"
146-
f"Exponent: {vector.input.exponent} "
147-
f"({int.from_bytes(vector.input.exponent, byteorder='big')})"
148143
)
149144
return calculated_gas
150145
except Exception as e:

tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -59,58 +59,9 @@ def test_vectors_from_legacy_tests(
5959
)
6060

6161

62-
def create_modexp_input(
63-
bsize: int, esize: int, msize: int, e_data: str = "", m_data: str = "", b_data: str = ""
64-
) -> bytes:
65-
"""
66-
Create ModExp input data with specified sizes and data.
67-
68-
Args:
69-
bsize: Base size in bytes
70-
esize: Exponent size in bytes
71-
msize: Modulus size in bytes
72-
e_data: Exponent data (hex string, if not provided, will be padded with FF)
73-
m_data: Modulus data (hex string, if not provided, will be padded with FF)
74-
b_data: Base data (hex string, if not provided, will be padded with FF)
75-
76-
Returns:
77-
ModExp input as bytes
78-
79-
"""
80-
e_padded = "FF" * esize if not e_data else e_data
81-
m_padded = "FF" * msize if not m_data else m_data
82-
b_padded = "FF" * bsize if not b_data else b_data
83-
84-
# Format sizes as 32-byte hex strings
85-
bsize_hex = format(bsize, "032x")
86-
esize_hex = format(esize, "032x")
87-
msize_hex = format(msize, "032x")
88-
89-
# Concatenate all parts
90-
input_hex = bsize_hex + esize_hex + msize_hex + e_padded + m_padded + b_padded
91-
return bytes.fromhex(input_hex)
92-
93-
9462
@pytest.mark.parametrize(
9563
"modexp_input,",
9664
[
97-
pytest.param(bytes(), id="zero-length-calldata"),
98-
pytest.param(
99-
create_modexp_input(10, 11, 12, b_data="FF" * 9),
100-
id="b-too-short",
101-
),
102-
pytest.param(
103-
create_modexp_input(10, 11, 12, m_data="FF" * 10),
104-
id="m-too-short",
105-
),
106-
pytest.param(
107-
create_modexp_input(10, 11, 12, e_data="FF" * 11),
108-
id="e-too-short",
109-
),
110-
pytest.param(
111-
create_modexp_input(0, 0, 0),
112-
id="all-zeros",
113-
),
11465
# These invalid inputs are from EIP-7823.
11566
# Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7823.md#analysis
11667
pytest.param(

0 commit comments

Comments
 (0)