Skip to content

Commit

Permalink
tests: add spec and conftest for transient storage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danceratopz committed Aug 24, 2023
1 parent ceb452b commit cdd416c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/cancun/eip1153_tstore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
EIP-1153 Tests
"""
14 changes: 14 additions & 0 deletions tests/cancun/eip1153_tstore/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Pytest plugin local to EIP-1153 tests.
"""
from typing import List

import pytest


@pytest.fixture(autouse=True)
def eips(eip_enabled: bool = True) -> List[int]:
"""
Returns a list of EIPs to enable in the client t8n tool.
"""
return [1153] if eip_enabled else []
30 changes: 30 additions & 0 deletions tests/cancun/eip1153_tstore/spec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
Defines EIP-1153 specification constants and functions.
"""
from dataclasses import dataclass


@dataclass(frozen=True)
class ReferenceSpec:
"""
Defines the reference spec version and git path.
"""

git_path: str
version: str


ref_spec_1153 = ReferenceSpec("EIPS/eip-1153.md", "6f0be621c76a05a7b3aaf0e9297afd425c26e9d0")


@dataclass(frozen=True)
class Spec:
"""
Parameters from the EIP-1153 specifications as defined at
https://eips.ethereum.org/EIPS/eip-1153
"""

TLOAD_OPCODE_BYTE = 0x5C
TSTORE_OPCODE_BYTE = 0x5D
TLOAD_GAS_COST = 100
TSTORE_GAS_COST = 100

0 comments on commit cdd416c

Please sign in to comment.