@@ -77,33 +77,45 @@ def create_modexp_input(
77
77
78
78
79
79
@pytest .mark .parametrize (
80
- "modexp_input,modexp_expected,call_succeeds " ,
80
+ "modexp_input," ,
81
81
[
82
- pytest .param (bytes (), bytes (), False , id = "zero-length-calldata" ),
82
+ pytest .param (bytes (), id = "zero-length-calldata" ),
83
83
pytest .param (
84
84
create_modexp_input (10 , 11 , 12 , b_data = "FF" * 9 ),
85
- bytes (),
86
- False ,
87
85
id = "b-too-short" ,
88
86
),
89
87
pytest .param (
90
88
create_modexp_input (10 , 11 , 12 , m_data = "FF" * 10 ),
91
- bytes (),
92
- False ,
93
89
id = "m-too-short" ,
94
90
),
95
91
pytest .param (
96
92
create_modexp_input (10 , 11 , 12 , e_data = "FF" * 11 ),
97
- bytes (),
98
- False ,
99
93
id = "e-too-short" ,
100
94
),
101
95
pytest .param (
102
96
create_modexp_input (0 , 0 , 0 ),
103
- bytes (),
104
- False ,
105
97
id = "all-zeros" ,
106
98
),
99
+ # These invalid inputs are from EIP-7823.
100
+ # Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7823.md#analysis
101
+ pytest .param (
102
+ bytes .fromhex ("9e5faafc" ),
103
+ id = "invalid-case-1" ,
104
+ ),
105
+ pytest .param (
106
+ bytes .fromhex ("85474728" ),
107
+ id = "invalid-case-2" ,
108
+ ),
109
+ pytest .param (
110
+ bytes .fromhex ("9e281a98" + "00" * 54 + "021e19e0c9bab2400000" ),
111
+ id = "invalid-case-3" ,
112
+ ),
113
+ ],
114
+ )
115
+ @pytest .mark .parametrize (
116
+ "modexp_expected,call_succeeds" ,
117
+ [
118
+ pytest .param (bytes (), False ),
107
119
],
108
120
)
109
121
@EIPChecklist .Precompile .Test .Inputs .AllZeros
0 commit comments