test_selfdestruct_pre_existing()¶
Documentation for tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_selfdestruct_pre_existing@verkle@v0.0.6.
Generate fixtures for these test cases for Shanghai with:
Shanghai only:
fill -v tests/cancun/eip6780_selfdestruct/test_selfdestruct.py::test_selfdestruct_pre_existing --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::test_selfdestruct_pre_existing --until=Shanghai
Test calling a previously created account that contains a selfdestruct, and verify its balance is sent to the destination address.
After EIP-6780, the balance should be sent to the send-all recipient address, similar to the behavior before the EIP, but the account is not deleted.
Test using
- Different send-all recipient addresses: single, multiple, including self
- Different initial balances for the self-destructing contract
Source code in tests/cancun/eip6780_selfdestruct/test_selfdestruct.py
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 | |
Parametrized Test Cases¶
The interactive table below is also available as a standalone page.
Skipped Parameters
For more concise readability, the table below does not list the following parameter values:
fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.
| Test ID | sendall_recipient_addresses | selfdestruct_contract_initial_balance | call_times |
|---|---|---|---|
| selfdestruct_contract_initial_balance_0-single_call | ['pre_deploy_contract_1'] | 0 | 1 |
| selfdestruct_contract_initial_balance_0-single_call_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 1 |
| selfdestruct_contract_initial_balance_0-multiple_calls_single_sendall_recipient | ['pre_deploy_contract_1'] | 0 | 2 |
| selfdestruct_contract_initial_balance_0-multiple_calls_single_self_recipient | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 2 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_sendall_recipients | ['pre_deploy_contract_1', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 0 | 3 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 0 | 3 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 3 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_repeating_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 0 | 6 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_repeating_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 6 |
| selfdestruct_contract_initial_balance_100000-single_call | ['pre_deploy_contract_1'] | 100000 | 1 |
| selfdestruct_contract_initial_balance_100000-single_call_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 1 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_single_sendall_recipient | ['pre_deploy_contract_1'] | 100000 | 2 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_single_self_recipient | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 2 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_sendall_recipients | ['pre_deploy_contract_1', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 100000 | 3 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 100000 | 3 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 3 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_repeating_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 100000 | 6 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_repeating_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 6 |
| selfdestruct_contract_initial_balance_0-single_call | ['pre_deploy_contract_1'] | 0 | 1 |
| selfdestruct_contract_initial_balance_0-single_call_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 1 |
| selfdestruct_contract_initial_balance_0-multiple_calls_single_sendall_recipient | ['pre_deploy_contract_1'] | 0 | 2 |
| selfdestruct_contract_initial_balance_0-multiple_calls_single_self_recipient | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 2 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_sendall_recipients | ['pre_deploy_contract_1', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 0 | 3 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 0 | 3 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 3 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_repeating_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 0 | 6 |
| selfdestruct_contract_initial_balance_0-multiple_calls_multiple_repeating_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 0 | 6 |
| selfdestruct_contract_initial_balance_100000-single_call | ['pre_deploy_contract_1'] | 100000 | 1 |
| selfdestruct_contract_initial_balance_100000-single_call_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 1 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_single_sendall_recipient | ['pre_deploy_contract_1'] | 100000 | 2 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_single_self_recipient | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 2 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_sendall_recipients | ['pre_deploy_contract_1', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 100000 | 3 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 100000 | 3 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 3 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_repeating_sendall_recipients_including_self | [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01', 'pre_deploy_contract_2', 'pre_deploy_contract_3'] | 100000 | 6 |
| selfdestruct_contract_initial_balance_100000-multiple_calls_multiple_repeating_sendall_recipients_including_self_last | ['pre_deploy_contract_1', 'pre_deploy_contract_2', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'] | 100000 | 6 |