Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(test): test opcode programs in different scenarios #808

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
117 changes: 117 additions & 0 deletions converted-ethereum-tests.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,120 @@
([#808](https://github.com/ethereum/execution-spec-tests/pull/808))
GeneralStateTests/stBadOpcode/invalidDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc1EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc1FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2ADiffPlaces.json
GeneralStateTests/stBadOpcode/opc2BDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4ADiffPlaces.json
GeneralStateTests/stBadOpcode/opc4BDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc21DiffPlaces.json
GeneralStateTests/stBadOpcode/opc22DiffPlaces.json
GeneralStateTests/stBadOpcode/opc23DiffPlaces.json
GeneralStateTests/stBadOpcode/opc24DiffPlaces.json
GeneralStateTests/stBadOpcode/opc25DiffPlaces.json
GeneralStateTests/stBadOpcode/opc26DiffPlaces.json
GeneralStateTests/stBadOpcode/opc27DiffPlaces.json
GeneralStateTests/stBadOpcode/opc28DiffPlaces.json
GeneralStateTests/stBadOpcode/opc29DiffPlaces.json
GeneralStateTests/stBadOpcode/opc49DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcAADiffPlaces.json
GeneralStateTests/stBadOpcode/opcABDiffPlaces.json
GeneralStateTests/stBadOpcode/opcACDiffPlaces.json
GeneralStateTests/stBadOpcode/opcADDiffPlaces.json
GeneralStateTests/stBadOpcode/opcAEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcAFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcB0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcBADiffPlaces.json
GeneralStateTests/stBadOpcode/opcBBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcC0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcCADiffPlaces.json
GeneralStateTests/stBadOpcode/opcCBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcD0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcDADiffPlaces.json
GeneralStateTests/stBadOpcode/opcDBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcE0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcEADiffPlaces.json
GeneralStateTests/stBadOpcode/opcEBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcECDiffPlaces.json
GeneralStateTests/stBadOpcode/opcEDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcEEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcEFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcF6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcF7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcF8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcF9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcFBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcFCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcFEDiffPlaces.json

([#748](https://github.com/ethereum/execution-spec-tests/pull/748))
GeneralStateTests/stBadOpcode/badOpcodes.json
GeneralStateTests/stBugs/evmBytecode.json
Expand Down
8 changes: 7 additions & 1 deletion src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def fn(
assert (
authorization_list_or_count is None
), f"Authorizations are not supported in {cls.name()}"

intrinsic_cost: int = gas_costs.G_TRANSACTION

if contract_creation:
Expand Down Expand Up @@ -619,7 +620,12 @@ def valid_opcodes(
cls,
) -> List[Opcodes]:
"""Return list of Opcodes that are valid to work on this fork."""
return [Opcodes.RETURNDATASIZE, Opcodes.STATICCALL] + super(Byzantium, cls).valid_opcodes()
return [
Opcodes.REVERT,
Opcodes.RETURNDATASIZE,
Opcodes.RETURNDATACOPY,
Opcodes.STATICCALL,
] + super(Byzantium, cls).valid_opcodes()


class Constantinople(Byzantium):
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_vm/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def __new__(
instance.lambda_operation = lambda_operation
return instance

def __call__(self, *args_t: OpcodeCallArg) -> Bytecode:
def __call__(self, *args_t: OpcodeCallArg, **kwargs) -> Bytecode:
"""Perform macro operation if any. Otherwise is a no-op."""
if self.lambda_operation is not None:
return self.lambda_operation(*args_t)
Expand Down
1 change: 1 addition & 0 deletions tests/frontier/scenarios/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Scenarios common import."""
Loading
Loading