Skip to content

Instantly share code, notes, and snippets.

@veox
Created Dec 10, 2018
Embed
What would you like to do?
py-evm /BlockchainTests diff to get state diff
diff --git a/eth/chains/base.py b/eth/chains/base.py
index ac85ef9c..e8db78d7 100644
--- a/eth/chains/base.py
+++ b/eth/chains/base.py
@@ -703,7 +703,7 @@ class Chain(BaseChain):
# Validate the imported block.
if perform_validation:
- validate_imported_block_unchanged(imported_block, block)
+ #validate_imported_block_unchanged(imported_block, block)
self.validate_block(imported_block)
(
diff --git a/eth/tools/fixtures/helpers.py b/eth/tools/fixtures/helpers.py
index 06c0c15b..0340f9e3 100644
--- a/eth/tools/fixtures/helpers.py
+++ b/eth/tools/fixtures/helpers.py
@@ -40,6 +40,7 @@ from eth.vm.base import (
BaseVM,
)
from eth.vm.forks import (
+ ConstantinopleVM,
ByzantiumVM,
TangerineWhistleVM,
FrontierVM,
@@ -123,6 +124,10 @@ def chain_vm_configuration(fixture: Dict[str, Any]) -> Iterable[Tuple[int, Type[
return (
(0, ByzantiumVM),
)
+ elif network == 'Constantinople':
+ return (
+ (0, ConstantinopleVM),
+ )
elif network == 'FrontierToHomesteadAt5':
HomesteadVM = BaseHomesteadVM.configure(support_dao_fork=False)
return (
diff --git a/tests/conftest.py b/tests/conftest.py
index e298dc4d..98652e00 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -22,15 +22,16 @@ from eth.vm.forks.spurious_dragon import SpuriousDragonVM
# Uncomment this to have logs from tests written to a file. This is useful for
# debugging when you need to dump the VM output from test runs.
-"""
+
@pytest.yield_fixture(autouse=True)
def _file_logging(request):
import datetime
+ import logging
import os
logger = logging.getLogger('eth')
- level = TRACE_LEVEL_NUM
+ level = 5
#level = logging.DEBUG
#level = logging.INFO
@@ -53,7 +54,6 @@ def _file_logging(request):
yield logger
finally:
logger.removeHandler(handler)
-"""
@pytest.fixture
diff --git a/tests/json-fixtures/test_blockchain.py b/tests/json-fixtures/test_blockchain.py
index 1aa90289..8a27c4b5 100644
--- a/tests/json-fixtures/test_blockchain.py
+++ b/tests/json-fixtures/test_blockchain.py
@@ -71,7 +71,7 @@ def pytest_generate_tests(metafunc):
filter_fn=filter_fixtures(
fixtures_base_dir=BASE_FIXTURE_PATH,
mark_fn=blockchain_fixture_mark_fn,
- ignore_fn=blockchain_fixture_ignore_fn,
+ #ignore_fn=blockchain_fixture_ignore_fn,
),
)
@@ -84,8 +84,6 @@ def fixture(fixture_data):
fixture_key,
normalize_blockchain_fixtures,
)
- if fixture['network'] == 'Constantinople':
- pytest.skip('Constantinople VM rules not yet supported')
return fixture
@@ -122,7 +120,7 @@ def test_blockchain_fixtures(fixture_data, fixture):
if should_be_good_block:
(block, mined_block, block_rlp) = apply_fixture_block_to_chain(block_fixture, chain)
- assert_mined_block_unchanged(block, mined_block)
+ #assert_mined_block_unchanged(block, mined_block)
else:
try:
apply_fixture_block_to_chain(block_fixture, chain)
@@ -133,6 +131,6 @@ def test_blockchain_fixtures(fixture_data, fixture):
raise AssertionError("Block should have caused a validation error")
latest_block_hash = chain.get_canonical_block_by_number(chain.get_block().number - 1).hash
- assert latest_block_hash == fixture['lastblockhash']
+ #assert latest_block_hash == fixture['lastblockhash']
verify_account_db(fixture['postState'], chain.get_vm().state.account_db)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment