|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
'use strict' |
|
|
|
|
import { Transaction } from '@ethereumjs/tx' |
|
|
|
|
import { Block, BlockHeader } from '@ethereumjs/block' |
|
|
|
|
import { Block } from '@ethereumjs/block' |
|
|
|
|
import { BN, bufferToHex, Address } from 'ethereumjs-util' |
|
|
|
|
import { ExecutionContext } from './execution-context' |
|
|
|
|
import { EventManager } from '../eventManager' |
|
|
|
@ -127,15 +127,16 @@ export class TxRunner { |
|
|
|
|
const coinbases = ['0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e'] |
|
|
|
|
const difficulties = [new BN('69762765929000', 10), new BN('70762765929000', 10), new BN('71762765929000', 10)] |
|
|
|
|
|
|
|
|
|
const header: BlockHeader = BlockHeader.fromHeaderData({ |
|
|
|
|
timestamp: timestamp || (new Date().getTime() / 1000 | 0), |
|
|
|
|
number: self.blockNumber, |
|
|
|
|
coinbase: coinbases[self.blockNumber % coinbases.length], |
|
|
|
|
difficulty: difficulties[self.blockNumber % difficulties.length], |
|
|
|
|
gasLimit: new BN(gasLimit.replace('0x', ''), 16).imuln(2) |
|
|
|
|
var block = Block.fromBlockData({ |
|
|
|
|
header: { |
|
|
|
|
timestamp: timestamp || (new Date().getTime() / 1000 | 0), |
|
|
|
|
number: self.blockNumber, |
|
|
|
|
coinbase: coinbases[self.blockNumber % coinbases.length], |
|
|
|
|
difficulty: difficulties[self.blockNumber % difficulties.length], |
|
|
|
|
gasLimit: new BN(gasLimit.replace('0x', ''), 16).imuln(2) |
|
|
|
|
} |
|
|
|
|
}, { common: this.commonContext }) |
|
|
|
|
|
|
|
|
|
const block = new Block(header, [tx], []) |
|
|
|
|
|
|
|
|
|
if (!useCall) { |
|
|
|
|
++self.blockNumber |
|
|
|
|
this.runBlockInVm(tx, block, callback) |
|
|
|
|