Skip to content

Commit

Permalink
fix tox
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed May 22, 2024
1 parent 1af5456 commit fb06800
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
),
pytest.param(
# Check that valid EOF1 with two code sections deploys
# Check that return values are allowed on code sections that aren't zero (Data24)
# Check that return values are allowed on code sections that aren't zero (Data 24)
Container(
name="EOF1V0002+EOF1V0006",
sections=[
Expand All @@ -508,7 +508,7 @@
id="return_allowed_on_nonzero_sections",
),
pytest.param(
# Check return values on code sections affect maxStackHeight of the caller (Data25)
# Check return values on code sections affect maxStackHeight of the caller (Data 25)
Container(
name="EOF1V0012",
sections=[
Expand Down Expand Up @@ -556,7 +556,7 @@
id="non_terminating_opcode_in_section_code_fails",
),
pytest.param(
# Check sections that end with a non-terminator opcode fail (Data 26b)
# Check sections that end with a non-terminator opcode fail (Data 26 b)
Container(
name="EOF1I0024",
sections=[
Expand Down Expand Up @@ -668,7 +668,7 @@
id="stack_height_1024_invalid",
),
pytest.param(
# Check data stack height of 1024 is invalid (Data 29b)
# Check data stack height of 1024 is invalid (Data 29 b)
Container(
name="EOF1I0025",
sections=[
Expand Down Expand Up @@ -1149,7 +1149,7 @@
id="bad_magic",
),
pytest.param(
# Check that EOF1 with a bad version number fails (ver 0) (Data 45)
# Check that EOF1 with a bad version number fails (version 0) (Data 45)
Container(
name="EOF1I0002",
sections=[
Expand All @@ -1168,7 +1168,7 @@
id="bad_version",
),
pytest.param(
# Check that EOF1 with a bad version number fails (ver 2) (Data 45a)
# Check that EOF1 with a bad version number fails (version 2) (Data 45 a)
Container(
name="EOF1I0002",
sections=[
Expand Down
13 changes: 12 additions & 1 deletion tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@


class SectionTest(Enum):
"""
Enum for the test type
"""

MISSING = 1
WRONG_ORDER = 2


class TestPosition(Enum):
"""
Enum for the test position
"""

BODY = 1
HEADER = 2
BODY_AND_HEADER = 3
Expand All @@ -41,6 +49,9 @@ class TestPosition(Enum):
def get_expected_code_exception(
section_kind, section_test, test_position
) -> tuple[str, EOFException | None]:
"""
Verification vectors with code and exception based on test combinations
"""
match (section_kind, section_test, test_position):
case (SectionKind.TYPE, SectionTest.MISSING, TestPosition.HEADER):
return "ef000102000100030400010000800001305000ef", EOFException.MISSING_TYPE_HEADER
Expand Down Expand Up @@ -73,7 +84,7 @@ def get_expected_code_exception(
return (
"ef000101000402000100030400010000800001ef",
# TODO should be an exception of empty code bytes, because it can understand that
# ef byte is data section byte
# last byte is data section byte
EOFException.INVALID_SECTION_BODIES_SIZE,
)
case (SectionKind.CODE, SectionTest.MISSING, TestPosition.BODY_AND_HEADER):
Expand Down
1 change: 1 addition & 0 deletions whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ oprypin
origin
ori
parseable
parsers
pathlib
pdb
perf
Expand Down

0 comments on commit fb06800

Please sign in to comment.