Skip to content

Commit 8397062

Browse files
authored
new(tests): add a test case for EOF code header missing (#1193)
1 parent 093d119 commit 8397062

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

converted-ethereum-tests.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ EOFTests/efValidation/dataloadn_.json
2121
EOFTests/efValidation/EOF1_embedded_container_.json
2222
EOFTests/efValidation/EOF1_eofcreate_valid_.json
2323
EOFTests/efValidation/EOF1_callf_truncated_.json
24+
EOFTests/efValidation/EOF1_code_section_missing_.json
2425
EOFTests/efValidation/EOF1_dataloadn_truncated_.json
2526
EOFTests/efValidation/EOF1_multiple_type_sections_.py
2627
EOFTests/efValidation/EOF1_no_type_section_.json

tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_container_validation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,15 @@ def test_valid_containers(
217217
raw_bytes=bytes([0xEF, 0x00, 0x01, 0x01, 0x00, 0x04, 0x00]),
218218
validity_error=[EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
219219
),
220+
Container(
221+
name="no_code_header_4",
222+
sections=[
223+
Section(kind=SectionKind.TYPE, data="00800000"),
224+
Section.Data("da"),
225+
],
226+
expected_bytecode="ef0001 010004 040001 00 00800000 da",
227+
validity_error=[EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
228+
),
220229
Container(
221230
name="code_section_count_missing",
222231
raw_bytes=bytes([0xEF, 0x00, 0x01, 0x01, 0x00, 0x04, 0x02]),

0 commit comments

Comments
 (0)