-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add spec and conftest for transient storage tests
- Loading branch information
1 parent
ceb452b
commit cdd416c
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
EIP-1153 Tests | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |