@@ -123,6 +123,32 @@ def test_mul(vm_class, val1, val2, expected):
123
123
assert result == expected
124
124
125
125
126
+ @pytest .mark .parametrize (
127
+ 'vm_class, base, exponent, expected' ,
128
+ (
129
+ (ByzantiumVM , 0 , 1 , 0 ,),
130
+ (ByzantiumVM , 0 , 0 , 1 ,),
131
+ (SpuriousDragonVM , 0 , 1 , 0 ,),
132
+ (SpuriousDragonVM , 0 , 0 , 1 ,),
133
+ (TangerineWhistleVM , 0 , 1 , 0 ,),
134
+ (TangerineWhistleVM , 0 , 0 , 1 ,),
135
+ (HomesteadVM , 0 , 1 , 0 ,),
136
+ (HomesteadVM , 0 , 0 , 1 ,),
137
+ (FrontierVM , 0 , 1 , 0 ,),
138
+ (FrontierVM , 0 , 0 , 1 ,),
139
+ )
140
+ )
141
+ def test_exp (vm_class , base , exponent , expected ):
142
+ computation = prepare_computation (vm_class )
143
+ computation .stack_push (exponent )
144
+ computation .stack_push (base )
145
+ computation .opcodes [opcode_values .EXP ](computation )
146
+
147
+ result = computation .stack_pop (type_hint = constants .UINT256 )
148
+
149
+ assert result == expected
150
+
151
+
126
152
@pytest .mark .parametrize (
127
153
# Testcases from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md#shl-shift-left
128
154
'vm_class, val1, val2, expected' ,
0 commit comments