Skip to content

Commit

Permalink
Enable Constantinople State tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Oct 17, 2018
1 parent 8007af4 commit 79af447
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ jobs:
- image: circleci/python:3.5
environment:
TOXENV: py35-native-state-byzantium
py35-native-state-constantinople:
<<: *common
docker:
- image: circleci/python:3.5
environment:
TOXENV: py35-native-state-constantinople
py35-native-state-frontier:
<<: *common
docker:
Expand Down Expand Up @@ -175,6 +181,12 @@ jobs:
- image: circleci/python:3.6
environment:
TOXENV: py36-native-state-byzantium
py36-native-state-constantinople:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: py36-native-state-constantinople
py36-native-state-frontier:
<<: *common
docker:
Expand Down Expand Up @@ -205,6 +217,12 @@ jobs:
- image: circleci/python:3.6
environment:
TOXENV: py36-rpc-state-byzantium
py36-rpc-state-constantinople:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: py36-rpc-state-constantinople
py36-rpc-state-frontier:
<<: *common
docker:
Expand Down Expand Up @@ -341,11 +359,13 @@ workflows:
- py37-beacon

- py36-native-state-byzantium
- py36-native-state-constantinople
- py36-native-state-frontier
- py36-native-state-homestead
- py36-native-state-eip150
- py36-native-state-eip158
- py36-rpc-state-byzantium
- py36-rpc-state-constantinople
- py36-rpc-state-frontier
- py36-rpc-state-homestead
- py36-rpc-state-eip150
Expand All @@ -365,6 +385,7 @@ workflows:
- py36-beacon

- py35-native-state-byzantium
- py35-native-state-constantinople
- py35-native-state-frontier
- py35-native-state-homestead
- py35-native-state-eip150
Expand Down
13 changes: 12 additions & 1 deletion tests/json-fixtures/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
HomesteadVM,
SpuriousDragonVM,
ByzantiumVM,
ConstantinopleVM,
)
from eth.vm.forks.tangerine_whistle.state import TangerineWhistleState
from eth.vm.forks.frontier.state import FrontierState
from eth.vm.forks.homestead.state import HomesteadState
from eth.vm.forks.spurious_dragon.state import SpuriousDragonState
from eth.vm.forks.byzantium.state import ByzantiumState
from eth.vm.forks.constantinople.state import ConstantinopleState

from eth.rlp.headers import (
BlockHeader,
Expand Down Expand Up @@ -224,6 +226,10 @@ def get_prev_hashes_testing(self, last_block_hash, db):
__name__='ByzantiumStateForTesting',
get_ancestor_hash=get_block_hash_for_testing,
)
ConstantinopleStateForTesting = ConstantinopleState.configure(
__name__='ConstantinopleStateForTesting',
get_ancestor_hash=get_block_hash_for_testing,
)

FrontierVMForTesting = FrontierVM.configure(
__name__='FrontierVMForTesting',
Expand All @@ -250,6 +256,11 @@ def get_prev_hashes_testing(self, last_block_hash, db):
_state_class=ByzantiumStateForTesting,
get_prev_hashes=get_prev_hashes_testing,
)
ConstantinopleVMForTesting = ConstantinopleVM.configure(
__name__='ConstantinopleVMForTesting',
_state_class=ConstantinopleStateForTesting,
get_prev_hashes=get_prev_hashes_testing,
)


@pytest.fixture
Expand All @@ -266,7 +277,7 @@ def fixture_vm_class(fixture_data):
elif fork_name == ForkName.Byzantium:
return ByzantiumVMForTesting
elif fork_name == ForkName.Constantinople:
pytest.skip("Constantinople VM has not been implemented")
return ConstantinopleVMForTesting
elif fork_name == ForkName.Metropolis:
pytest.skip("Metropolis VM has not been implemented")
else:
Expand Down
5 changes: 4 additions & 1 deletion tests/json-fixtures/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
from eth.vm.forks.byzantium.transactions import (
ByzantiumTransaction
)
from eth.vm.forks.constantinople.transactions import (
ConstantinopleTransaction
)

from eth_typing.enums import (
ForkName
Expand Down Expand Up @@ -90,7 +93,7 @@ def fixture_transaction_class(fixture_data):
elif fork_name == ForkName.Byzantium:
return ByzantiumTransaction
elif fork_name == ForkName.Constantinople:
pytest.skip("Constantinople Transaction class has not been implemented")
return ConstantinopleTransaction
elif fork_name == ForkName.Metropolis:
pytest.skip("Metropolis Transaction class has not been implemented")
else:
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist=
py{35,36}-{core,database,transactions,vm,native-blockchain}
py{36}-{benchmark,p2p,trinity,lightchain_integration,beacon}
py{36}-rpc-blockchain
py{36}-rpc-state-{frontier,homestead,eip150,eip158,byzantium,quadratic}
py{36}-rpc-state-{frontier,homestead,eip150,eip158,byzantium,constantinople,quadratic}
py{35,36}-native-state-{frontier,homestead,eip150,eip158,byzantium,constantinople,metropolis}
py37-{core,trinity,trinity-integration,beacon}
py{35,36}-lint
Expand Down Expand Up @@ -32,6 +32,7 @@ commands=
beacon: pytest {posargs:tests/beacon/}
# The following test seems to consume a lot of memory. Restricting to 3 processes reduces crashes
rpc-state-byzantium: pytest -n3 {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Byzantium'}
rpc-state-constantinople: pytest -n3 {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Constantinople'}
rpc-state-quadratic: pytest {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stQuadraticComplexityTest'}
transactions: pytest {posargs:tests/json-fixtures/test_transactions.py}
vm: pytest {posargs:tests/json-fixtures/test_virtual_machine.py}
Expand Down

0 comments on commit 79af447

Please sign in to comment.