From fb4f29de32f62ce58913d973966b86fe461825f8 Mon Sep 17 00:00:00 2001 From: Mario Vega Date: Thu, 27 Jun 2024 16:38:54 +0000 Subject: [PATCH] fix(tests): import fixes --- .../test_all_opcodes_in_container.py | 4 ++-- .../eip3540_eof_v1/test_container_size.py | 4 ++-- .../eip3540_eof_v1/test_container_validation.py | 4 ++-- .../eip3540_eof_v1/test_eof_example.py | 16 +++++----------- .../eip3540_eof_v1/test_example_valid_invalid.py | 6 +++--- .../eip3540_eof_v1/test_section_order.py | 13 +++---------- .../eip3540_eof_v1/test_section_size.py | 4 ++-- 7 files changed, 19 insertions(+), 32 deletions(-) diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_all_opcodes_in_container.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_all_opcodes_in_container.py index 67898b7b51..c20d392ad7 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_all_opcodes_in_container.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_all_opcodes_in_container.py @@ -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 diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py index ea3771c4a1..d31fdc445e 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_size.py @@ -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 diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_validation.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_validation.py index 0e6efee3e4..e9a27e36a9 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_validation.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_container_validation.py @@ -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 diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_eof_example.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_eof_example.py index 31e79578d2..0ecaad8228 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_eof_example.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_eof_example.py @@ -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 @@ -129,7 +123,7 @@ 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", @@ -137,8 +131,8 @@ def test_eof_example_custom_fields(eof_test: EOFTestFiller): ) 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, ): """ diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_example_valid_invalid.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_example_valid_invalid.py index 734663ad7e..d31c74fd85 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_example_valid_invalid.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_example_valid_invalid.py @@ -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 @@ -59,7 +59,7 @@ ), Section.Data("0xef"), ], - header_terminator=Bytes(b"\xFF"), + header_terminator=b"\xFF", ), "ef00010100040200010003040001ff00800001305000ef", EOFException.MISSING_TERMINATOR, diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_order.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_order.py index 294ef9237a..d0f3703617 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_order.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_order.py @@ -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 @@ -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), diff --git a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_size.py b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_size.py index ab767c074b..96eb30def0 100644 --- a/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_size.py +++ b/tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_section_size.py @@ -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