Skip to content

Commit b1586fb

Browse files
committed
Handle sealEngine in blockchain tests
1 parent f80381f commit b1586fb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

eth/tools/fixtures/helpers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
from eth import MainnetChain
1212
from eth.db.atomic import AtomicDB
13+
from eth.tools.builder.chain import (
14+
disable_pow_check,
15+
)
1316
from eth.utils.state import (
1417
diff_account_db,
1518
)
@@ -156,6 +159,9 @@ def new_chain_from_fixture(fixture, chain_cls=MainnetChain):
156159
vm_configuration=vm_config,
157160
)
158161

162+
if 'sealEngine' in fixture and fixture['sealEngine'] == 'NoProof':
163+
ChainFromFixture = disable_pow_check(ChainFromFixture)
164+
159165
return ChainFromFixture.from_genesis(
160166
base_db,
161167
genesis_params=genesis_params_from_fixture(fixture),

eth/tools/fixtures/normalization.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ def normalize_blockchain_fixtures(fixture):
497497
'network': fixture['network'],
498498
}
499499

500+
if 'sealEngine' in fixture:
501+
normalized_fixture['sealEngine'] = fixture['sealEngine']
502+
500503
if 'genesisRLP' in fixture:
501504
normalized_fixture['genesisRLP'] = decode_hex(fixture['genesisRLP'])
502505

0 commit comments

Comments
 (0)