fix linting issues

pull/7/head
Iuri Matias 5 years ago
parent b677f78534
commit 60128e636d
  1. 6
      remix-lib/src/execution/execution-context.js
  2. 9
      remix-lib/src/execution/txRunner.js

@ -276,14 +276,14 @@ function ExecutionContext () {
} }
this.addBlock = function (block) { this.addBlock = function (block) {
let blockNumber = "0x" + block.header.number.toString('hex') let blockNumber = '0x' + block.header.number.toString('hex')
blockNumber = web3.toHex(web3.toBigNumber(blockNumber)) blockNumber = web3.toHex(web3.toBigNumber(blockNumber))
self.blocks["0x" + block.hash().toString('hex')] = block self.blocks['0x' + block.hash().toString('hex')] = block
self.blocks[blockNumber] = block self.blocks[blockNumber] = block
} }
this.trackTx = function(tx, block) { this.trackTx = function (tx, block) {
self.txs[tx] = block self.txs[tx] = block
} }
} }

@ -13,7 +13,7 @@ class TxRunner {
this.blockNumber = 0 this.blockNumber = 0
this.runAsync = true this.runAsync = true
if (executionContext.isVM()) { if (executionContext.isVM()) {
//this.blockNumber = 1150000 // The VM is running in Homestead mode, which started at this block. // this.blockNumber = 1150000 // The VM is running in Homestead mode, which started at this block.
this.blockNumber = 2 // The VM is running in Homestead mode, which started at this block. this.blockNumber = 2 // The VM is running in Homestead mode, which started at this block.
this.runAsync = false // We have to run like this cause the VM Event Manager does not support running multiple txs at the same time. this.runAsync = false // We have to run like this cause the VM Event Manager does not support running multiple txs at the same time.
} }
@ -94,7 +94,7 @@ class TxRunner {
} }
} }
runInVm(from, to, data, value, gasLimit, useCall, timestamp, callback) { runInVm (from, to, data, value, gasLimit, useCall, timestamp, callback) {
const self = this const self = this
var account = self.vmaccounts[from] var account = self.vmaccounts[from]
if (!account) { if (!account) {
@ -119,8 +119,7 @@ class TxRunner {
number: self.blockNumber, number: self.blockNumber,
coinbase: coinbases[self.blockNumber % coinbases.length], coinbase: coinbases[self.blockNumber % coinbases.length],
difficulty: difficulties[self.blockNumber % difficulties.length], difficulty: difficulties[self.blockNumber % difficulties.length],
coinbase: coinbases[0], gasLimit: new BN('5000000').imuln(1)
gasLimit: new BN("5000000").imuln(1)
}, },
transactions: [tx], transactions: [tx],
uncleHeaders: [] uncleHeaders: []
@ -144,7 +143,7 @@ class TxRunner {
} }
executionContext.addBlock(block) executionContext.addBlock(block)
executionContext.trackTx("0x" + tx.hash().toString('hex'), block) executionContext.trackTx('0x' + tx.hash().toString('hex'), block)
callback(err, { callback(err, {
result: result, result: result,

Loading…
Cancel
Save