fix initial block generation

pull/7/head
Iuri Matias 6 years ago
parent 80f1a9ac3a
commit dc0865fc8c
  1. 3
      remix-lib/src/execution/execution-context.js
  2. 2
      remix-lib/src/execution/txRunner.js
  3. 2
      remix-simulator/src/genesis.js

@ -298,6 +298,9 @@ function ExecutionContext () {
this.addBlock = function (block) {
let blockNumber = '0x' + block.header.number.toString('hex')
if (blockNumber === "0x") {
blockNumber = "0x0"
}
blockNumber = web3.toHex(web3.toBigNumber(blockNumber))
self.blocks['0x' + block.hash().toString('hex')] = block

@ -14,7 +14,7 @@ class TxRunner {
this.runAsync = true
if (executionContext.isVM()) {
// 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 = 0 // 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.pendingTxs = {}

@ -8,7 +8,7 @@ function generateBlock () {
var block = new EthJSBlock({
header: {
timestamp: (new Date().getTime() / 1000 | 0),
number: 1,
number: 0,
coinbase: '0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a',
difficulty: (new BN('69762765929000', 10)),
gasLimit: new BN('8000000').imuln(1)

Loading…
Cancel
Save