Skip to content

Commit

Permalink
fix(fixtures): remove unused properties
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Sep 30, 2024
1 parent 6940bcb commit 1da5c9a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/ethereum_test_fixtures/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class BaseFixture(CamelModel):
output_file_extension: ClassVar[str] = ".json"
description: ClassVar[str] = "Unknown fixture format; it has not been set."

is_verifiable: ClassVar[bool] = False

@classmethod
def output_base_dir_name(cls) -> str:
"""
Expand Down
2 changes: 0 additions & 2 deletions src/ethereum_test_fixtures/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,6 @@ class FixtureCommon(BaseFixture):
Base blockchain test fixture model.
"""

is_verifiable: ClassVar[bool] = True

fork: str = Field(..., alias="network")
genesis: FixtureHeader = Field(..., alias="genesisBlockHeader")
pre: Alloc
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_fixtures/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def verify_fixture_files(self, evm_fixture_verification: FixtureVerifier) -> Non
"""
for fixture_path, name_fixture_dict in self.all_fixtures.items():
for fixture_name, fixture in name_fixture_dict.items():
if fixture.is_verifiable:
if evm_fixture_verification.is_verifiable(fixture.__class__):
info = self.json_path_to_test_item[fixture_path]
verify_fixtures_dump_dir = self._get_verify_fixtures_dump_dir(info)
evm_fixture_verification.verify_fixture(
Expand Down
2 changes: 0 additions & 2 deletions src/ethereum_test_fixtures/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ class Fixture(BaseFixture):
fixture_format_name: ClassVar[str] = "state_test"
description: ClassVar[str] = "Tests that generate a state test fixture."

is_verifiable: ClassVar[bool] = True

env: FixtureEnvironment
pre: Alloc
transaction: FixtureTransaction
Expand Down
9 changes: 9 additions & 0 deletions src/ethereum_test_fixtures/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ class FixtureVerifier(ABC):
Abstract class for verifying Ethereum test fixtures.
"""

def is_verifiable(
self,
fixture_format: FixtureFormat,
) -> bool:
"""
Returns whether the fixture format is verifiable by this verifier.
"""
return False

@abstractmethod
def verify_fixture(
self,
Expand Down
9 changes: 9 additions & 0 deletions src/evm_transition_tool/geth.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ def get_blocktest_help(self) -> str:
raise Exception(f"Unexpected exception calling evm tool: {e}.")
return result.stdout

def is_verifiable(
self,
fixture_format: FixtureFormat,
) -> bool:
"""
Returns whether the fixture format is verifiable by this Geth's evm tool.
"""
return fixture_format in {StateFixture, BlockchainFixture}

def verify_fixture(
self,
fixture_format: FixtureFormat,
Expand Down

0 comments on commit 1da5c9a

Please sign in to comment.