Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Zen and the art of provider engine maintenance #39

Merged
merged 2 commits into from
Mar 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"license": "ISC",
"dependencies": {
"async": "^1.5.2",
"ethereumjs-account": "^1.0.5",
"ethereumjs-account": "^2.0.2",
"ethereumjs-block": "^1.2.2",
"ethereumjs-tx": "^1.0.0",
"ethereumjs-util": "^2.3.1",
"ethereumjs-vm": "1.2.0",
"ethereumjs-tx": "^1.1.0",
"ethereumjs-util": "^4.0.0",
"ethereumjs-vm": "^1.2.1",
"fake-merkle-patricia-tree": "^1.0.1",
"isomorphic-fetch": "^2.2.0",
"request": "^2.67.0",
Expand Down
8 changes: 4 additions & 4 deletions subproviders/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const inherits = require('util').inherits
const VM = require('ethereumjs-vm')
const Block = require('ethereumjs-block')
const Account = require('ethereumjs-account')
const Transaction = require('ethereumjs-tx')
const FakeTransaction = require('ethereumjs-tx/fake.js')
const FakeMerklePatriciaTree = require('fake-merkle-patricia-tree')
const ethUtil = require('ethereumjs-util')
const createPayload = require('../util/create-payload.js')
Expand Down Expand Up @@ -84,7 +84,8 @@ VmSubprovider.prototype.runVm = function(payload, cb){
// create tx
var txParams = payload.params[0]
// console.log('params:', payload.params)
var tx = new Transaction({

var tx = new FakeTransaction({
to: txParams.to,
from: txParams.from,
value: txParams.value,
Expand All @@ -93,13 +94,12 @@ VmSubprovider.prototype.runVm = function(payload, cb){
gasPrice: txParams.gasPrice,
nonce: txParams.nonce,
})
tx._from = ethUtil.toBuffer(txParams.from)

vm.runTx({
tx: tx,
block: block,
skipNonce: true,
skipBalance: true,
skipBalance: true
}, function(err, results) {
if (err) return cb(err)
if (results.error != null) {
Expand Down
4 changes: 2 additions & 2 deletions test/util/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ function createBlock(blockParams, prevBlock, txs) {
}

function incrementHex(hexString){
return '0x'+ethUtil.intToHex(Number(hexString)+1)
return ethUtil.intToHex(Number(hexString)+1)
}

function randomHash(){
return '0x'+ethUtil.intToHex(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))
return ethUtil.intToHex(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))
}