Skip to content

Commit 673e4df

Browse files
committed
Activate tests for Petersburg fork
1 parent 6701c64 commit 673e4df

File tree

7 files changed

+41
-2
lines changed

7 files changed

+41
-2
lines changed

.circleci/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ jobs:
8484
- image: circleci/python:3.5
8585
environment:
8686
TOXENV: py35-native-blockchain-homestead
87+
py35-native-blockchain-petersburg:
88+
<<: *common
89+
docker:
90+
- image: circleci/python:3.5
91+
environment:
92+
TOXENV: py35-native-blockchain-petersburg
8793
py35-native-blockchain-tangerine_whistle:
8894
<<: *common
8995
docker:
@@ -157,6 +163,12 @@ jobs:
157163
- image: circleci/python:3.6
158164
environment:
159165
TOXENV: py36-native-blockchain-homestead
166+
py36-native-blockchain-petersburg:
167+
<<: *common
168+
docker:
169+
- image: circleci/python:3.6
170+
environment:
171+
TOXENV: py36-native-blockchain-petersburg
160172
py36-native-blockchain-tangerine_whistle:
161173
<<: *common
162174
docker:
@@ -219,6 +231,7 @@ workflows:
219231
- py36-native-blockchain-constantinople
220232
- py36-native-blockchain-frontier
221233
- py36-native-blockchain-homestead
234+
- py36-native-blockchain-petersburg
222235
- py36-native-blockchain-tangerine_whistle
223236
- py36-native-blockchain-spurious_dragon
224237
- py36-native-blockchain-transition
@@ -232,6 +245,7 @@ workflows:
232245
- py35-native-blockchain-constantinople
233246
- py35-native-blockchain-frontier
234247
- py35-native-blockchain-homestead
248+
- py35-native-blockchain-petersburg
235249
- py35-native-blockchain-tangerine_whistle
236250
- py35-native-blockchain-spurious_dragon
237251
- py35-native-blockchain-transition

eth/tools/builder/chain/builders.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
SpuriousDragonVM,
7171
ByzantiumVM,
7272
ConstantinopleVM,
73+
PetersburgVM,
7374
)
7475

7576

@@ -225,7 +226,7 @@ def dao_fork_at(dao_fork_block_number: BlockNumber,
225226
spurious_dragon_at = fork_at(SpuriousDragonVM)
226227
byzantium_at = fork_at(ByzantiumVM)
227228
constantinople_at = fork_at(ConstantinopleVM)
228-
229+
petersburg_at = fork_at(PetersburgVM)
229230

230231
GENESIS_DEFAULTS = (
231232
('difficulty', 1),

eth/tools/fixtures/helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
BaseVM,
4444
)
4545
from eth.vm.forks import (
46+
PetersburgVM,
4647
ConstantinopleVM,
4748
ByzantiumVM,
4849
TangerineWhistleVM,
@@ -131,6 +132,10 @@ def chain_vm_configuration(fixture: Dict[str, Any]) -> Iterable[Tuple[int, Type[
131132
return (
132133
(0, ConstantinopleVM),
133134
)
135+
elif network == 'ConstantinopleFix':
136+
return (
137+
(0, PetersburgVM),
138+
)
134139
elif network == 'FrontierToHomesteadAt5':
135140
HomesteadVM = BaseHomesteadVM.configure(support_dao_fork=False)
136141
return (

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
SpuriousDragonVM,
2121
ByzantiumVM,
2222
ConstantinopleVM,
23+
PetersburgVM,
2324
)
2425

2526

@@ -71,6 +72,7 @@ def _file_logging(request):
7172
SpuriousDragonVM,
7273
ByzantiumVM,
7374
ConstantinopleVM,
75+
PetersburgVM,
7476
])
7577
def VM(request):
7678
return request.param

tests/core/chain-object/test_contract_call.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
SpuriousDragonVM,
2727
ByzantiumVM,
2828
ConstantinopleVM,
29+
PetersburgVM,
2930
)
3031

3132

@@ -202,6 +203,16 @@ def test_get_transaction_result(
202203
'useLotsOfGas()',
203204
OutOfGas,
204205
),
206+
(
207+
PetersburgVM,
208+
'doRevert()',
209+
Revert,
210+
),
211+
(
212+
PetersburgVM,
213+
'useLotsOfGas()',
214+
OutOfGas,
215+
),
205216
),
206217
)
207218
def test_get_transaction_result_revert(

tests/json-fixtures/test_transactions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
from eth.vm.forks.constantinople.transactions import (
3232
ConstantinopleTransaction
3333
)
34+
from eth.vm.forks.petersburg.transactions import (
35+
PetersburgTransaction
36+
)
3437

3538
from eth_typing.enums import (
3639
ForkName
@@ -96,6 +99,8 @@ def fixture_transaction_class(fixture_data):
9699
return ByzantiumTransaction
97100
elif fork_name == ForkName.Constantinople:
98101
return ConstantinopleTransaction
102+
elif fork_name == "Petersburg":
103+
return PetersburgTransaction
99104
elif fork_name == ForkName.Metropolis:
100105
pytest.skip("Metropolis Transaction class has not been implemented")
101106
else:

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
envlist=
33
py{35,36}-{core,database,transactions,vm}
44
py{36}-{benchmark}
5-
py{35,36}-native-blockchain-{frontier,homestead,tangerine_whistle,spurious_dragon,byzantium,constantinople,metropolis,transition}
5+
py{35,36}-native-blockchain-{frontier,homestead,tangerine_whistle,spurious_dragon,byzantium,constantinople,petersburg,metropolis,transition}
66
py37-{core}
77
py{35,36}-lint
88
py36-docs
@@ -28,6 +28,7 @@ commands=
2828
native-blockchain-spurious_dragon: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork EIP158}
2929
native-blockchain-byzantium: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Byzantium}
3030
native-blockchain-constantinople: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Constantinople}
31+
native-blockchain-petersburg: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork ConstantinopleFix}
3132
native-blockchain-metropolis: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Metropolis}
3233
native-blockchain-transition: pytest {posargs:tests/json-fixtures/test_blockchain.py -k BlockchainTests/TransitionTests}
3334

0 commit comments

Comments
 (0)