Skip to content

Commit e0a1f64

Browse files
committed
Enable Constantinople State tests
1 parent 6db668f commit e0a1f64

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

.circleci/config.yml

+21
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ jobs:
108108
- image: circleci/python:3.5
109109
environment:
110110
TOXENV: py35-native-state-byzantium
111+
py35-native-state-constantinople:
112+
<<: *common
113+
docker:
114+
- image: circleci/python:3.5
115+
environment:
116+
TOXENV: py35-native-state-constantinople
111117
py35-native-state-frontier:
112118
<<: *common
113119
docker:
@@ -175,6 +181,12 @@ jobs:
175181
- image: circleci/python:3.6
176182
environment:
177183
TOXENV: py36-native-state-byzantium
184+
py36-native-state-constantinople:
185+
<<: *common
186+
docker:
187+
- image: circleci/python:3.6
188+
environment:
189+
TOXENV: py36-native-state-constantinople
178190
py36-native-state-frontier:
179191
<<: *common
180192
docker:
@@ -205,6 +217,12 @@ jobs:
205217
- image: circleci/python:3.6
206218
environment:
207219
TOXENV: py36-rpc-state-byzantium
220+
py36-rpc-state-constantinople:
221+
<<: *common
222+
docker:
223+
- image: circleci/python:3.6
224+
environment:
225+
TOXENV: py36-rpc-state-constantinople
208226
py36-rpc-state-frontier:
209227
<<: *common
210228
docker:
@@ -328,11 +346,13 @@ workflows:
328346
- py37-trinity-integration
329347

330348
- py36-native-state-byzantium
349+
- py36-native-state-constantinople
331350
- py36-native-state-frontier
332351
- py36-native-state-homestead
333352
- py36-native-state-eip150
334353
- py36-native-state-eip158
335354
- py36-rpc-state-byzantium
355+
- py36-rpc-state-constantinople
336356
- py36-rpc-state-frontier
337357
- py36-rpc-state-homestead
338358
- py36-rpc-state-eip150
@@ -351,6 +371,7 @@ workflows:
351371
- py36-rpc-state-quadratic
352372

353373
- py35-native-state-byzantium
374+
- py35-native-state-constantinople
354375
- py35-native-state-frontier
355376
- py35-native-state-homestead
356377
- py35-native-state-eip150

tests/json-fixtures/test_state.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
HomesteadVM,
2929
SpuriousDragonVM,
3030
ByzantiumVM,
31+
ConstantinopleVM,
3132
)
3233
from eth.vm.forks.tangerine_whistle.state import TangerineWhistleState
3334
from eth.vm.forks.frontier.state import FrontierState
3435
from eth.vm.forks.homestead.state import HomesteadState
3536
from eth.vm.forks.spurious_dragon.state import SpuriousDragonState
3637
from eth.vm.forks.byzantium.state import ByzantiumState
38+
from eth.vm.forks.constantinople.state import ConstantinopleState
3739

3840
from eth.rlp.headers import (
3941
BlockHeader,
@@ -224,6 +226,10 @@ def get_prev_hashes_testing(self, last_block_hash, db):
224226
__name__='ByzantiumStateForTesting',
225227
get_ancestor_hash=get_block_hash_for_testing,
226228
)
229+
ConstantinopleStateForTesting = ConstantinopleState.configure(
230+
__name__='ConstantinopleStateForTesting',
231+
get_ancestor_hash=get_block_hash_for_testing,
232+
)
227233

228234
FrontierVMForTesting = FrontierVM.configure(
229235
__name__='FrontierVMForTesting',
@@ -250,6 +256,11 @@ def get_prev_hashes_testing(self, last_block_hash, db):
250256
_state_class=ByzantiumStateForTesting,
251257
get_prev_hashes=get_prev_hashes_testing,
252258
)
259+
ConstantinopleVMForTesting = ConstantinopleVM.configure(
260+
__name__='ConstantinopleVMForTesting',
261+
_state_class=ConstantinopleStateForTesting,
262+
get_prev_hashes=get_prev_hashes_testing,
263+
)
253264

254265

255266
@pytest.fixture
@@ -266,7 +277,7 @@ def fixture_vm_class(fixture_data):
266277
elif fork_name == ForkName.Byzantium:
267278
return ByzantiumVMForTesting
268279
elif fork_name == ForkName.Constantinople:
269-
pytest.skip("Constantinople VM has not been implemented")
280+
return ConstantinopleVMForTesting
270281
elif fork_name == ForkName.Metropolis:
271282
pytest.skip("Metropolis VM has not been implemented")
272283
else:

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist=
33
py{35,36}-{core,database,transactions,vm,native-blockchain}
44
py{36}-{benchmark,p2p,trinity,lightchain_integration}
55
py{36}-rpc-blockchain
6-
py{36}-rpc-state-{frontier,homestead,eip150,eip158,byzantium,quadratic}
6+
py{36}-rpc-state-{frontier,homestead,eip150,eip158,byzantium,constantinople,quadratic}
77
py{35,36}-native-state-{frontier,homestead,eip150,eip158,byzantium,constantinople,metropolis}
88
py37-{core,trinity,trinity-integration}
99
py{35,36}-lint
@@ -30,6 +30,7 @@ commands=
3030
rpc-state-eip158: pytest {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and EIP158'}
3131
# The following test seems to consume a lot of memory. Restricting to 3 processes reduces crashes
3232
rpc-state-byzantium: pytest -n3 {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Byzantium'}
33+
rpc-state-constantinople: pytest -n3 {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Constantinople'}
3334
rpc-state-quadratic: pytest {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stQuadraticComplexityTest'}
3435
transactions: pytest {posargs:tests/json-fixtures/test_transactions.py}
3536
vm: pytest {posargs:tests/json-fixtures/test_virtual_machine.py}

0 commit comments

Comments
 (0)