Skip to content

Commit

Permalink
Rm generateCanonicalGenesis from runBlock api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s1na authored and holgerd77 committed Mar 14, 2019
1 parent 5cf9fd4 commit 35bbb75
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = function (config) {
exclude: [
'./tests/api/state/stateManager.js', // 4, "# should clear the cache when the state root is set"
'./tests/api/index.js', // 11, "# should run blockchain with mocked runBlock" not working"
'./tests/api/runBlock.js', // 3, "# should fail when runTx fails"
'./tests/api/runBlockchain.js' // 2, "# should run with valid and invalid blocks"
],

Expand Down
9 changes: 1 addition & 8 deletions tests/api/runBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function setup (vm = null) {
data: testData,
p: {
runBlock: promisify(runBlock.bind(vm)),
putAccount: promisify(vm.stateManager.putAccount.bind(vm.stateManager)),
generateCanonicalGenesis: promisify(vm.stateManager.generateCanonicalGenesis.bind(vm.stateManager))
putAccount: promisify(vm.stateManager.putAccount.bind(vm.stateManager))
}
}
}
Expand All @@ -59,8 +58,6 @@ tape('runBlock', async (t) => {
t.test('should fail when runTx fails', async (st) => {
const block = new Block(util.rlp.decode(suite.data.blocks[0].rlp))

await suite.p.generateCanonicalGenesis()

// The mocked VM uses a mocked runTx
// which always returns an error.
await suite.p.runBlock({ block, skipBlockValidation: true })
Expand Down Expand Up @@ -108,8 +105,6 @@ tape('should fail when tx gas limit higher than block gas limit', async (t) => {
const block = new Block(util.rlp.decode(suite.data.blocks[0].rlp))
block.transactions[0].gasLimit = Buffer.from('3fefba', 'hex')

await suite.p.generateCanonicalGenesis()

await suite.p.runBlock({ block, skipBlockValidation: true })
.then(() => t.fail('should have returned error'))
.catch((e) => t.ok(e.message.includes('higher gas limit')))
Expand All @@ -128,8 +123,6 @@ tape('should fail when runCall fails', async (t) => {
await suite.p.putAccount(tx.from.toString('hex'), acc)
}

await suite.p.generateCanonicalGenesis()

// The mocked VM uses a mocked runCall
// which always returns an error.
// runTx is a full implementation that works.
Expand Down

0 comments on commit 35bbb75

Please sign in to comment.