Skip to content

Commit

Permalink
Pass fork parameter to the VM in test runner, updated API in README
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Jul 20, 2018
1 parent 55959c3 commit 0b3c5d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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' (will throw on unsupported)]
- `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).

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VM.deps = {
* @param {Trie} [opts.state] A merkle-patricia-tree instance for the state tree (ignored if stateManager is passed)
* @param {Blockchain} [opts.blockchain] A blockchain object for storing/retrieving blocks (ignored if stateManager is passed)
* @param {String|Number} opts.chain The chain the VM operates on [default: 'mainnet']
* @param {String} opts.hardfork Hardfork rules to be used [default: 'byzantium', supported: 'byzantium']
* @param {String} opts.hardfork Hardfork rules to be used [default: 'byzantium', supported: 'byzantium' (will throw on unsupported)]
* @param {Boolean} [opts.activatePrecompiles] Create entries in the state tree for the precompiled contracts
* @param {Boolean} [opts.allowUnlimitedContractSize] Allows unlimited contract sizes while debugging (default: false; ONLY use during debugging)
*/
Expand Down
3 changes: 2 additions & 1 deletion tests/BlockchainTestsRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 2 additions & 1 deletion tests/GeneralStateTestsRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down

0 comments on commit 0b3c5d1

Please sign in to comment.