From da8fc6c7ced9d365a59ee9a366443b8b4445bb48 Mon Sep 17 00:00:00 2001 From: Christoph Burgdorf Date: Tue, 16 Oct 2018 13:32:38 +0200 Subject: [PATCH] Handle sealEngine in blockchain tests --- eth/tools/fixtures/helpers.py | 6 ++++++ eth/tools/fixtures/normalization.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/eth/tools/fixtures/helpers.py b/eth/tools/fixtures/helpers.py index 4511e2320c..26bcd14a35 100644 --- a/eth/tools/fixtures/helpers.py +++ b/eth/tools/fixtures/helpers.py @@ -10,6 +10,9 @@ from eth import MainnetChain from eth.db.atomic import AtomicDB +from eth.tools.builder.chain import ( + disable_pow_check, +) from eth.utils.state import ( diff_account_db, ) @@ -156,6 +159,9 @@ def new_chain_from_fixture(fixture, chain_cls=MainnetChain): vm_configuration=vm_config, ) + if 'sealEngine' in fixture and fixture['sealEngine'] == 'NoProof': + ChainFromFixture = disable_pow_check(ChainFromFixture) + return ChainFromFixture.from_genesis( base_db, genesis_params=genesis_params_from_fixture(fixture), diff --git a/eth/tools/fixtures/normalization.py b/eth/tools/fixtures/normalization.py index 8b80361001..89b78657ae 100644 --- a/eth/tools/fixtures/normalization.py +++ b/eth/tools/fixtures/normalization.py @@ -495,6 +495,9 @@ def normalize_blockchain_fixtures(fixture): 'network': fixture['network'], } + if 'sealEngine' in fixture: + normalized_fixture['sealEngine'] = fixture['sealEngine'] + if 'genesisRLP' in fixture: normalized_fixture['genesisRLP'] = decode_hex(fixture['genesisRLP'])