From 68b87fb1ca3a99c7a386749bc0fb4c0620b9a0a7 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Fri, 22 Jun 2018 11:16:49 +0200 Subject: [PATCH] Pass fork parameter to the VM in test runner, updated API in README --- README.md | 2 ++ tests/BlockchainTestsRunner.js | 3 ++- tests/GeneralStateTestsRunner.js | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8679781623..e2f1f8ffc5 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ Creates a new VM object - `stateManager` - A state manager instance (**EXPERIMENTAL** - unstable API) - `state` - A merkle-patricia-tree instance for the state tree (ignored if `stateManager` is passed) - `blockchain` - A blockchain object for storing/retrieving blocks (ignored if `stateManager` is passed) + - `chain` - The chain the VM operates on [default: 'mainnet'] + - `hardfork` - Hardfork rules to be used [default: 'byzantium', supported: 'byzantium'] - `activatePrecompiles` - Create entries in the state tree for the precompiled contracts - `allowUnlimitedContractSize` - Allows unlimited contract sizes while debugging. By setting this to `true`, the check for contract size limit of 2KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. (default: `false`; **ONLY** set to `true` during debugging). diff --git a/tests/BlockchainTestsRunner.js b/tests/BlockchainTestsRunner.js index 6a00547f4d..19caa778ba 100644 --- a/tests/BlockchainTestsRunner.js +++ b/tests/BlockchainTestsRunner.js @@ -23,7 +23,8 @@ module.exports = function runBlockchainTest (options, testData, t, cb) { } var vm = new VM({ state: state, - blockchain: blockchain + blockchain: blockchain, + hardfork: options.forkConfig.toLowerCase() }) var genesisBlock = new Block() diff --git a/tests/GeneralStateTestsRunner.js b/tests/GeneralStateTestsRunner.js index 96a251d7e9..24d80d522a 100644 --- a/tests/GeneralStateTestsRunner.js +++ b/tests/GeneralStateTestsRunner.js @@ -54,7 +54,8 @@ function runTestCase (options, testData, t, cb) { VM = require('../lib/index.js') } vm = new VM({ - state: state + state: state, + hardfork: options.forkConfig.toLowerCase() }) testUtil.setupPreConditions(state, testData, done) },