Skip to content

Commit 9c9eb17

Browse files
committed
Enable more generic tests against Berlin
1 parent b663aca commit 9c9eb17

File tree

7 files changed

+517
-15
lines changed

7 files changed

+517
-15
lines changed

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
ConstantinopleVM,
3232
PetersburgVM,
3333
IstanbulVM,
34+
MuirGlacierVM,
35+
BerlinVM,
3436
)
3537

3638
#
@@ -89,6 +91,8 @@ def _file_logging(request):
8991
ConstantinopleVM,
9092
PetersburgVM,
9193
IstanbulVM,
94+
MuirGlacierVM,
95+
BerlinVM,
9296
])
9397
def VM(request):
9498
return request.param

tests/core/builder-tools/test_chain_construction.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from eth.chains.base import MiningChain
66
from eth.consensus.pow import check_pow
77
from eth.tools.builder.chain import (
8+
berlin_at,
89
build,
910
byzantium_at,
1011
chain_id,
@@ -33,6 +34,7 @@
3334
PetersburgVM,
3435
IstanbulVM,
3536
MuirGlacierVM,
37+
BerlinVM,
3638
)
3739

3840

@@ -85,6 +87,7 @@ def test_chain_builder_construct_chain_vm_configuration_multiple_forks():
8587
(petersburg_at, PetersburgVM),
8688
(istanbul_at, IstanbulVM),
8789
(muir_glacier_at, MuirGlacierVM),
90+
(berlin_at, BerlinVM),
8891
(latest_mainnet_at, MuirGlacierVM), # this will change whenever the next upgrade is locked
8992
)
9093
)

tests/core/chain-object/test_contract_call.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
ConstantinopleVM,
2828
PetersburgVM,
2929
IstanbulVM,
30+
MuirGlacierVM,
31+
BerlinVM,
3032
)
3133

3234

@@ -223,6 +225,26 @@ def test_get_transaction_result(
223225
'useLotsOfGas()',
224226
OutOfGas,
225227
),
228+
(
229+
MuirGlacierVM,
230+
'doRevert()',
231+
Revert,
232+
),
233+
(
234+
MuirGlacierVM,
235+
'useLotsOfGas()',
236+
OutOfGas,
237+
),
238+
(
239+
BerlinVM,
240+
'doRevert()',
241+
Revert,
242+
),
243+
(
244+
BerlinVM,
245+
'useLotsOfGas()',
246+
OutOfGas,
247+
),
226248
),
227249
)
228250
def test_get_transaction_result_revert(

tests/core/chain-object/test_gas_estimation.py

Lines changed: 148 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
ConstantinopleVM,
1414
PetersburgVM,
1515
IstanbulVM,
16+
MuirGlacierVM,
17+
BerlinVM,
1618
)
1719
from eth._utils.address import force_bytes_to_address
1820

@@ -608,6 +610,150 @@
608610
22272,
609611
id='sha3 precompile 32 bytes 1000_tolerance binary pending for IstanbulVM',
610612
),
613+
pytest.param(
614+
b'',
615+
None,
616+
ADDR_1010,
617+
True,
618+
MuirGlacierVM,
619+
21000,
620+
id='simple default pending for MuirGlacierVM',
621+
),
622+
pytest.param(
623+
b'',
624+
None,
625+
ADDR_1010,
626+
False,
627+
MuirGlacierVM,
628+
21000,
629+
id='simple default for MuirGlacierVM',
630+
),
631+
pytest.param(
632+
b'\xff' * 10,
633+
None,
634+
ADDR_1010,
635+
True,
636+
MuirGlacierVM,
637+
21160,
638+
id='10 bytes default pending for MuirGlacierVM',
639+
),
640+
pytest.param(
641+
b'\xff' * 10,
642+
None,
643+
ADDR_1010,
644+
False,
645+
MuirGlacierVM,
646+
21160,
647+
id='10 bytes default for MuirGlacierVM',
648+
),
649+
pytest.param(
650+
b'\xff' * 32,
651+
None,
652+
ADDRESS_2,
653+
True,
654+
MuirGlacierVM,
655+
33675,
656+
id='sha3 precompile 32 bytes default pending for MuirGlacierVM',
657+
),
658+
pytest.param(
659+
b'\xff' * 32,
660+
None,
661+
ADDRESS_2,
662+
False,
663+
MuirGlacierVM,
664+
33687,
665+
id='sha3 precompile 32 bytes default for MuirGlacierVM',
666+
),
667+
pytest.param(
668+
b'\xff' * 320,
669+
None,
670+
ADDRESS_2,
671+
True,
672+
MuirGlacierVM,
673+
38265,
674+
id='sha3 precompile 320 bytes default pending for MuirGlacierVM',
675+
),
676+
pytest.param(
677+
b'\xff' * 32,
678+
binary_gas_search_1000_tolerance,
679+
ADDRESS_2,
680+
True,
681+
MuirGlacierVM,
682+
22272,
683+
id='sha3 precompile 32 bytes 1000_tolerance binary pending for MuirGlacierVM',
684+
),
685+
pytest.param(
686+
b'',
687+
None,
688+
ADDR_1010,
689+
True,
690+
BerlinVM,
691+
21000,
692+
id='simple default pending for BerlinVM',
693+
),
694+
pytest.param(
695+
b'',
696+
None,
697+
ADDR_1010,
698+
False,
699+
BerlinVM,
700+
21000,
701+
id='simple default for BerlinVM',
702+
),
703+
pytest.param(
704+
b'\xff' * 10,
705+
None,
706+
ADDR_1010,
707+
True,
708+
BerlinVM,
709+
21160,
710+
id='10 bytes default pending for BerlinVM',
711+
),
712+
pytest.param(
713+
b'\xff' * 10,
714+
None,
715+
ADDR_1010,
716+
False,
717+
BerlinVM,
718+
21160,
719+
id='10 bytes default for BerlinVM',
720+
),
721+
pytest.param(
722+
b'\xff' * 32,
723+
None,
724+
ADDRESS_2,
725+
True,
726+
BerlinVM,
727+
33675,
728+
id='sha3 precompile 32 bytes default pending for BerlinVM',
729+
),
730+
pytest.param(
731+
b'\xff' * 32,
732+
None,
733+
ADDRESS_2,
734+
False,
735+
BerlinVM,
736+
33687,
737+
id='sha3 precompile 32 bytes default for BerlinVM',
738+
),
739+
pytest.param(
740+
b'\xff' * 320,
741+
None,
742+
ADDRESS_2,
743+
True,
744+
BerlinVM,
745+
38265,
746+
id='sha3 precompile 320 bytes default pending for BerlinVM',
747+
),
748+
pytest.param(
749+
b'\xff' * 32,
750+
binary_gas_search_1000_tolerance,
751+
ADDRESS_2,
752+
True,
753+
BerlinVM,
754+
22272,
755+
id='sha3 precompile 32 bytes 1000_tolerance binary pending for BerlinVM',
756+
),
611757
),
612758
)
613759
def test_estimate_gas(
@@ -667,7 +813,8 @@ def test_estimate_gas(
667813
(ConstantinopleVM, 722760),
668814
(PetersburgVM, 722760),
669815
(IstanbulVM, 186120),
670-
816+
(MuirGlacierVM, 186120),
817+
(BerlinVM, 186120),
671818
)
672819
)
673820
def test_estimate_gas_on_full_block(

0 commit comments

Comments
 (0)