test_extcodehash_call_to_selfdestruct()¶
Documentation for tests/constantinople/eip1052_extcodehash/test_extcodehash.py::test_extcodehash_call_to_selfdestruct@b314d18e.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/constantinople/eip1052_extcodehash/test_extcodehash.py::test_extcodehash_call_to_selfdestruct --fork Amsterdam
Test EXTCODEHASH after calling a contract that selfdestructs.
Call a contract containing SELFDESTRUCT using each call type, then check EXTCODEHASH. The hash is always returned because the check happens within the same transaction. STATICCALL fails because SELFDESTRUCT modifies state. Pre-Cancun, CALLCODE/DELEGATECALL execute SELFDESTRUCT in the caller's context, destroying the test contract at end of transaction.
Source code in tests/constantinople/eip1052_extcodehash/test_extcodehash.py
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 | |
Parametrized Test Cases¶
This test generates 4 parametrized test cases across 10 forks.