Skip to content

Test SELFDESTRUCT

Documentation for tests/cancun/eip6780_selfdestruct/test_selfdestruct.py@verkle@v0.0.4.

Generate fixtures for these test cases for Shanghai with:

Shanghai only:

fill -v tests/cancun/eip6780_selfdestruct/test_selfdestruct.py --fork=Shanghai --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Shanghai:

fill -v tests/cancun/eip6780_selfdestruct/test_selfdestruct.py --until=Shanghai

Test Functions Overview

Name Type Cases Description
test_create_selfdestruct_same_tx state_test 72 Use CREATE or CREATE2 to create a self-destructing contract, and call it in the same
test_self_destructing_initcode state_test 16 Test that a contract can self-destruct in its initcode.
test_self_destructing_initcode_create_tx state_test 8 Use a Create Transaction to execute a self-destructing initcode.
test_recreate_self_destructed_contract_different_txs blockchain_test 4 Test that a contract can be recreated after it has self-destructed, over the lapse
test_selfdestruct_pre_existing state_test 36 Test calling a previously created account that contains a selfdestruct, and verify its balance
test_selfdestruct_created_same_block_different_tx blockchain_test 4 Test that if an account created in the same block that contains a selfdestruct is
test_calling_from_new_contract_to_pre_existing_contract state_test 8 Test that if an account created in the current transaction delegate-call a previously created
test_calling_from_pre_existing_contract_to_new_contract state_test 32 Test that if an account created in the current transaction contains a self-destruct and is
test_create_selfdestruct_same_tx_increased_nonce state_test 16 Verify that a contract can self-destruct if it was created in the same transaction, even when