Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/frontier/scenarios/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ def result(self) -> ProgramResult:
"""Test program result."""
pass

def __str__(self) -> str:
"""Return the ID (for use as pytest test name)."""
return self.id


@dataclass
class ScenarioDebug:
Expand Down
77 changes: 37 additions & 40 deletions tests/frontier/scenarios/test_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,44 +104,6 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
return scenarios_list


program_classes = [
ProgramSstoreSload(),
ProgramTstoreTload(),
ProgramLogs(),
ProgramSuicide(),
ProgramInvalidOpcode(),
ProgramAddress(),
ProgramBalance(),
ProgramOrigin(),
ProgramCaller(),
ProgramCallValue(),
ProgramCallDataLoad(),
ProgramCallDataSize(),
ProgramCallDataCopy(),
ProgramCodeCopyCodeSize(),
ProgramGasPrice(),
ProgramExtCodeCopyExtCodeSize(),
ProgramReturnDataSize(),
ProgramReturnDataCopy(),
ProgramExtCodehash(),
ProgramBlockhash(),
ProgramCoinbase(),
ProgramTimestamp(),
ProgramNumber(),
ProgramDifficultyRandao(),
ProgramGasLimit(),
ProgramChainid(),
ProgramSelfbalance(),
ProgramBasefee(),
ProgramBlobhash(),
ProgramBlobBaseFee(),
ProgramTload(),
ProgramMcopy(),
ProgramPush0(),
ProgramAllFrontierOpcodes(),
]


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/Templates/DiffPlaces/templateGen.js",
Expand All @@ -151,6 +113,7 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stSelfBalance/diffPlacesFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/808"],
coverage_missed_reason=("Original test pre-sets storage of some of the deployed accounts."),
)
@pytest.mark.valid_from("Frontier")
@pytest.mark.parametrize(
Expand All @@ -169,8 +132,42 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
)
@pytest.mark.parametrize(
"test_program",
program_classes,
ids=[cls.id for cls in program_classes],
[
ProgramSstoreSload(),
ProgramTstoreTload(),
ProgramLogs(),
ProgramSuicide(),
pytest.param(ProgramInvalidOpcode(), marks=[pytest.mark.slow()]),
ProgramAddress(),
ProgramBalance(),
ProgramOrigin(),
ProgramCaller(),
ProgramCallValue(),
ProgramCallDataLoad(),
ProgramCallDataSize(),
ProgramCallDataCopy(),
ProgramCodeCopyCodeSize(),
ProgramGasPrice(),
ProgramExtCodeCopyExtCodeSize(),
ProgramReturnDataSize(),
ProgramReturnDataCopy(),
ProgramExtCodehash(),
pytest.param(ProgramBlockhash(), marks=[pytest.mark.slow()]),
ProgramCoinbase(),
ProgramTimestamp(),
ProgramNumber(),
ProgramDifficultyRandao(),
ProgramGasLimit(),
ProgramChainid(),
ProgramSelfbalance(),
ProgramBasefee(),
ProgramBlobhash(),
ProgramBlobBaseFee(),
ProgramTload(),
ProgramMcopy(),
ProgramPush0(),
ProgramAllFrontierOpcodes(),
],
)
def test_scenarios(
blockchain_test: BlockchainTestFiller,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
REFERENCE_SPEC_GIT_PATH = ref_spec_2537.git_path
REFERENCE_SPEC_VERSION = ref_spec_2537.version

pytestmark = pytest.mark.valid_from("Prague")
pytestmark = [pytest.mark.valid_from("Prague"), pytest.mark.slow]

G1_MSM_K_INPUT_LENGTH = len(PointG1() + Scalar())
G2_MSM_K_INPUT_LENGTH = len(PointG2() + Scalar())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def generate_block_check_code(
[1, Spec.BLOCKHASH_OLD_WINDOW + 1],
],
)
@pytest.mark.slow()
@pytest.mark.valid_at_transition_to("Prague")
def test_block_hashes_history_at_transition(
blockchain_test: BlockchainTestFiller,
Expand Down
Loading