Skip to content

Commit 34e29a9

Browse files
committed
Added usage of sealEngine (new blockchain test format) to blockchain tests
1 parent e24909e commit 34e29a9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/BlockchainTestsRunner.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,20 @@ module.exports = function runBlockchainTest (options, testData, t, cb) {
1313
db: require('memdown')
1414
})
1515
var state = new Trie()
16+
var validate = false
17+
// Only run with block validation when sealEngine present in test file
18+
// and being set to Ethash PoW validation
19+
if (testData.sealEngine && testData.sealEngine === 'Ethash') {
20+
validate = true
21+
}
1622
var blockchain = new Blockchain({
1723
db: blockchainDB,
18-
hardfork: options.forkConfig.toLowerCase()
24+
hardfork: options.forkConfig.toLowerCase(),
25+
validate: validate
1926
})
20-
blockchain.ethash.cacheDB = cacheDB
27+
if (validate) {
28+
blockchain.ethash.cacheDB = cacheDB
29+
}
2130
var VM
2231
if (options.dist) {
2332
VM = require('../dist/index.js')

0 commit comments

Comments
 (0)