Commit dc0865fc authored by Iuri Matias's avatar Iuri Matias

fix initial block generation

parent 80f1a9ac
...@@ -298,6 +298,9 @@ function ExecutionContext () { ...@@ -298,6 +298,9 @@ 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')
if (blockNumber === "0x") {
blockNumber = "0x0"
}
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
......
...@@ -14,7 +14,7 @@ class TxRunner { ...@@ -14,7 +14,7 @@ class TxRunner {
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 = 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.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 = {} this.pendingTxs = {}
......
...@@ -8,7 +8,7 @@ function generateBlock () { ...@@ -8,7 +8,7 @@ function generateBlock () {
var block = new EthJSBlock({ var block = new EthJSBlock({
header: { header: {
timestamp: (new Date().getTime() / 1000 | 0), timestamp: (new Date().getTime() / 1000 | 0),
number: 1, number: 0,
coinbase: '0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', coinbase: '0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a',
difficulty: (new BN('69762765929000', 10)), difficulty: (new BN('69762765929000', 10)),
gasLimit: new BN('8000000').imuln(1) gasLimit: new BN('8000000').imuln(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment