diff --git a/package.json b/package.json index c388ab079b..d9ca9f5382 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "async": "^2.1.2", "async-eventemitter": "^0.2.2", "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~1.7.0", + "ethereumjs-block": "~2.0.1", "ethereumjs-common": "~0.4.0", "ethereumjs-util": "^5.2.0", "fake-merkle-patricia-tree": "^1.0.1", @@ -50,7 +50,7 @@ "babel-cli": "^6.26.0", "babel-preset-env": "^1.6.1", "coveralls": "^3.0.0", - "ethereumjs-blockchain": "~2.1.0", + "ethereumjs-blockchain": "~3.2.1", "ethereumjs-testing": "git+https://github.com/ethereumjs/ethereumjs-testing.git#v1.1.1", "ethereumjs-tx": "1.3.3", "level": "^1.4.0", diff --git a/tests/BlockchainTestsRunner.js b/tests/BlockchainTestsRunner.js index 19caa778ba..1696d59034 100644 --- a/tests/BlockchainTestsRunner.js +++ b/tests/BlockchainTestsRunner.js @@ -13,7 +13,10 @@ module.exports = function runBlockchainTest (options, testData, t, cb) { db: require('memdown') }) var state = new Trie() - var blockchain = new Blockchain(blockchainDB) + var blockchain = new Blockchain({ + db: blockchainDB, + hardfork: options.forkConfig.toLowerCase() + }) blockchain.ethash.cacheDB = cacheDB var VM if (options.dist) { @@ -26,7 +29,7 @@ module.exports = function runBlockchainTest (options, testData, t, cb) { blockchain: blockchain, hardfork: options.forkConfig.toLowerCase() }) - var genesisBlock = new Block() + var genesisBlock = new Block({ hardfork: options.forkConfig.toLowerCase() }) testData.homestead = true if (testData.homestead) { @@ -48,7 +51,9 @@ module.exports = function runBlockchainTest (options, testData, t, cb) { }, function (done) { // create and add genesis block - genesisBlock.header = new BlockHeader(formatBlockHeader(testData.genesisBlockHeader)) + genesisBlock.header = new BlockHeader(formatBlockHeader(testData.genesisBlockHeader), { + hardfork: options.forkConfig.toLowerCase() + }) t.equal(state.root.toString('hex'), genesisBlock.header.stateRoot.toString('hex'), 'correct pre stateRoot') if (testData.genesisRLP) { t.equal(genesisBlock.serialize().toString('hex'), testData.genesisRLP.slice(2), 'correct genesis RLP') @@ -60,7 +65,9 @@ module.exports = function runBlockchainTest (options, testData, t, cb) { function (done) { async.eachSeries(testData.blocks, function (raw, cb) { try { - var block = new Block(Buffer.from(raw.rlp.slice(2), 'hex')) + var block = new Block(Buffer.from(raw.rlp.slice(2), 'hex'), { + hardfork: options.forkConfig.toLowerCase() + }) // forces the block into thinking they are homestead if (testData.homestead) { block.header.isHomestead = function () {