|
8 | 8 |
|
9 | 9 | from ethereum_test_base_types import to_json |
10 | 10 | from ethereum_test_base_types.pydantic import CopyValidateModel |
| 11 | +from ethereum_test_vm import Opcodes as Op |
11 | 12 |
|
12 | 13 | from ..eof.v1 import AutoSection, Container, Section, SectionKind |
13 | 14 |
|
|
651 | 652 | ), |
652 | 653 | """ |
653 | 654 | # EOF deployed code |
654 | | - ef0001 # Magic followed by bad version |
| 655 | + ef0001 # Magic followed by version |
655 | 656 | 020001 # One code segment |
656 | 657 | 0003 # code seg 0: 3 bytes |
657 | 658 | 010004 # One code segment |
|
690 | 691 | ), |
691 | 692 | """ |
692 | 693 | # EOF deployed code |
693 | | - ef0001 # Magic followed by bad version |
| 694 | + ef0001 # Magic followed by version |
694 | 695 | 010004 # One code segment |
695 | 696 | 020001 # One code segment |
696 | 697 | 0003 # code seg 0: 3 bytes |
|
725 | 726 | ), |
726 | 727 | """ |
727 | 728 | # EOF deployed code |
728 | | - ef0001 # Magic followed by bad version |
| 729 | + ef0001 # Magic followed by version |
729 | 730 | 020001 # One code segment |
730 | 731 | 0003 # code seg 0: 3 bytes |
731 | 732 | 040001 # One byte data segment |
|
759 | 760 | ), |
760 | 761 | """ |
761 | 762 | # EOF deployed code |
762 | | - ef0001 # Magic followed by bad version |
| 763 | + ef0001 # Magic followed by version |
763 | 764 | 010004 # Types section |
764 | 765 | 020001 # One code segment |
765 | 766 | 0003 # code seg 0: 3 bytes |
|
774 | 775 | ef |
775 | 776 | """, |
776 | 777 | ), |
| 778 | + ( |
| 779 | + "Container.Init simple test", |
| 780 | + Container.Init(deploy_container=Container.Code(b"\0")), |
| 781 | + """ |
| 782 | + # EOF deployed code |
| 783 | + ef0001 # Magic followed by version |
| 784 | + 010004 # Types section |
| 785 | + 020001 # One code segment |
| 786 | + 0006 # code seg 0: 6 bytes |
| 787 | + 030001 # One container segment |
| 788 | + 0014 # container seg 0: 20 bytes |
| 789 | + 040000 # Zero byte data segment |
| 790 | + 00 # End of header |
| 791 | + 0080 0002 # Types section |
| 792 | + # Code segment 0 code |
| 793 | + 6000 # 1 PUSH1 0 |
| 794 | + 6000 # 2 PUSH1 0 |
| 795 | + ee00 # 3 RETURNCONTRACT[0] |
| 796 | + # Subcontainer 0 |
| 797 | + ef0001 # Magic followed by version |
| 798 | + 010004 # Types section |
| 799 | + 020001 # One code segment |
| 800 | + 0001 # code seg 0: 1 byte |
| 801 | + 040000 # Zero byte data segment |
| 802 | + 00 # End of header |
| 803 | + 0080 0000 # Types section |
| 804 | + # Code segment 0 code |
| 805 | + 00 # 1 STOP |
| 806 | + """, |
| 807 | + ), |
| 808 | + ( |
| 809 | + "Container.Init initcode prefix", |
| 810 | + Container.Init(deploy_container=Container.Code(b"\0"), initcode_prefix=Op.SSTORE(0, 0)), |
| 811 | + """ |
| 812 | + # EOF deployed code |
| 813 | + ef0001 # Magic followed by version |
| 814 | + 010004 # Types section |
| 815 | + 020001 # One code segment |
| 816 | + 000b # code seg 0: 11 bytes |
| 817 | + 030001 # One container segment |
| 818 | + 0014 # container seg 0: 20 bytes |
| 819 | + 040000 # Zero byte data segment |
| 820 | + 00 # End of header |
| 821 | + 0080 0002 # Types section |
| 822 | + # Code segment 0 code |
| 823 | + 6000 # 1 PUSH1 0 |
| 824 | + 6000 # 2 PUSH1 0 |
| 825 | + 55 # 3 SSTORE |
| 826 | + 6000 # 4 PUSH1 0 |
| 827 | + 6000 # 5 PUSH1 0 |
| 828 | + ee00 # 6 RETURNCONTRACT[0] |
| 829 | + # Subcontainer 0 |
| 830 | + ef0001 # Magic followed by version |
| 831 | + 010004 # Types section |
| 832 | + 020001 # One code segment |
| 833 | + 0001 # code seg 0: 1 byte |
| 834 | + 040000 # Zero byte data segment |
| 835 | + 00 # End of header |
| 836 | + 0080 0000 # Types section |
| 837 | + # Code segment 0 code |
| 838 | + 00 # 1 STOP |
| 839 | + """, |
| 840 | + ), |
777 | 841 | ] |
778 | 842 |
|
779 | 843 |
|
|
0 commit comments