Skip to content

Commit

Permalink
Handle sealEngine in blockchain tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Oct 17, 2018
1 parent 082e285 commit da8fc6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eth/tools/fixtures/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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),
Expand Down
3 changes: 3 additions & 0 deletions eth/tools/fixtures/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down

0 comments on commit da8fc6c

Please sign in to comment.