Skip to content

Commit 79af447

Browse files
committed
Enable Constantinople State tests
1 parent 8007af4 commit 79af447

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
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:
@@ -341,11 +359,13 @@ workflows:
341359
- py37-beacon
342360

343361
- py36-native-state-byzantium
362+
- py36-native-state-constantinople
344363
- py36-native-state-frontier
345364
- py36-native-state-homestead
346365
- py36-native-state-eip150
347366
- py36-native-state-eip158
348367
- py36-rpc-state-byzantium
368+
- py36-rpc-state-constantinople
349369
- py36-rpc-state-frontier
350370
- py36-rpc-state-homestead
351371
- py36-rpc-state-eip150
@@ -365,6 +385,7 @@ workflows:
365385
- py36-beacon
366386

367387
- py35-native-state-byzantium
388+
- py35-native-state-constantinople
368389
- py35-native-state-frontier
369390
- py35-native-state-homestead
370391
- 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:

tests/json-fixtures/test_transactions.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
from eth.vm.forks.byzantium.transactions import (
2727
ByzantiumTransaction
2828
)
29+
from eth.vm.forks.constantinople.transactions import (
30+
ConstantinopleTransaction
31+
)
2932

3033
from eth_typing.enums import (
3134
ForkName
@@ -90,7 +93,7 @@ def fixture_transaction_class(fixture_data):
9093
elif fork_name == ForkName.Byzantium:
9194
return ByzantiumTransaction
9295
elif fork_name == ForkName.Constantinople:
93-
pytest.skip("Constantinople Transaction class has not been implemented")
96+
return ConstantinopleTransaction
9497
elif fork_name == ForkName.Metropolis:
9598
pytest.skip("Metropolis Transaction class has not been implemented")
9699
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,beacon}
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,beacon}
99
py{35,36}-lint
@@ -32,6 +32,7 @@ commands=
3232
beacon: pytest {posargs:tests/beacon/}
3333
# The following test seems to consume a lot of memory. Restricting to 3 processes reduces crashes
3434
rpc-state-byzantium: pytest -n3 {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Byzantium'}
35+
rpc-state-constantinople: pytest -n3 {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and not stQuadraticComplexityTest and Constantinople'}
3536
rpc-state-quadratic: pytest {posargs:tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py -k 'GeneralStateTests and stQuadraticComplexityTest'}
3637
transactions: pytest {posargs:tests/json-fixtures/test_transactions.py}
3738
vm: pytest {posargs:tests/json-fixtures/test_virtual_machine.py}

0 commit comments

Comments
 (0)