Skip to content

Commit

Permalink
fix(tests): import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Jun 27, 2024
1 parent 1c5ea7a commit fb4f29d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import pytest

from ethereum_test_tools import Bytecode, EOFTestFiller, Opcode
from ethereum_test_tools import Bytecode, EOFException, EOFTestFiller, Opcode
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools import UndefinedOpcodes
from ethereum_test_tools.eof.v1 import Container, EOFException, Section
from ethereum_test_tools.eof.v1 import Container, Section

from .. import EOF_FORK_NAME

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest

from ethereum_test_tools import EOFTestFiller
from ethereum_test_tools import EOFException, EOFTestFiller
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools.eof.v1 import Container, EOFException, Section
from ethereum_test_tools.eof.v1 import Container, Section
from ethereum_test_tools.eof.v1.constants import MAX_INITCODE_SIZE

from .. import EOF_FORK_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest

from ethereum_test_tools import EOFTestFiller
from ethereum_test_tools import EOFException, EOFTestFiller
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools.eof.v1 import Container, EOFException, Section
from ethereum_test_tools.eof.v1 import Container, Section

from .. import EOF_FORK_NAME

Expand Down
16 changes: 5 additions & 11 deletions tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_eof_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@

import pytest

from ethereum_test_tools import EOFTestFiller
from ethereum_test_tools import Bytecode, EOFException, EOFTestFiller
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools.eof.v1 import (
AutoSection,
BytesConvertible,
Container,
EOFException,
Section,
)
from ethereum_test_tools.eof.v1 import AutoSection, Container, Section

from .. import EOF_FORK_NAME

Expand Down Expand Up @@ -129,16 +123,16 @@ def test_eof_example_custom_fields(eof_test: EOFTestFiller):

@pytest.mark.parametrize(
"data_section_bytes",
("0x01", "0xef"),
(b"\x01", b"\xef"),
)
@pytest.mark.parametrize(
"code_section_code, exception",
[(Op.PUSH1(10) + Op.STOP, None), (Op.PUSH1(14), EOFException.MISSING_STOP_OPCODE)],
)
def test_eof_example_parameters(
eof_test: EOFTestFiller,
data_section_bytes: BytesConvertible,
code_section_code: BytesConvertible,
data_section_bytes: bytes,
code_section_code: Bytecode,
exception: EOFException,
):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest

from ethereum_test_tools import EOFTestFiller
from ethereum_test_tools import EOFException, EOFTestFiller
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools.eof.v1 import Bytes, Container, EOFException, Section
from ethereum_test_tools.eof.v1 import Container, Section

from .. import EOF_FORK_NAME

Expand Down Expand Up @@ -59,7 +59,7 @@
),
Section.Data("0xef"),
],
header_terminator=Bytes(b"\xFF"),
header_terminator=b"\xFF",
),
"ef00010100040200010003040001ff00800001305000ef",
EOFException.MISSING_TERMINATOR,
Expand Down
13 changes: 3 additions & 10 deletions tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@

import pytest

from ethereum_test_tools import EOFTestFiller
from ethereum_test_tools import EOFException, EOFTestFiller
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools.eof.v1 import (
AutoSection,
Bytes,
Container,
EOFException,
Section,
SectionKind,
)
from ethereum_test_tools.eof.v1 import AutoSection, Container, Section, SectionKind

from .. import EOF_FORK_NAME

Expand Down Expand Up @@ -175,7 +168,7 @@ def make_section_order(kind) -> List[Section]:
)
section_type = Section(
kind=SectionKind.TYPE,
data=Bytes.fromhex("00800001"),
data=bytes.fromhex("00800001"),
custom_size=4,
skip_header_listing=calculate_skip_flag(SectionKind.TYPE, CasePosition.HEADER),
skip_body_listing=calculate_skip_flag(SectionKind.TYPE, CasePosition.BODY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import pytest

from ethereum_test_tools import EOFTestFiller
from ethereum_test_tools import EOFException, EOFTestFiller
from ethereum_test_tools import Opcodes as Op
from ethereum_test_tools.eof.v1 import Container, EOFException, Section, SectionKind
from ethereum_test_tools.eof.v1 import Container, Section, SectionKind

from .. import EOF_FORK_NAME

Expand Down

0 comments on commit fb4f29d

Please sign in to comment.