From f5c9b020f07e97022ee2020ed7497cbcc7e35450 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 3 May 2016 13:01:42 +0100 Subject: [PATCH] Support block header parameters in VM mode (timestamp for now) Fix https://github.com/chriseth/browser-solidity/issues/90 --- src/universal-dapp.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 7b8e80147d..229af42aa3 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -569,7 +569,13 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { data: new Buffer(data.slice(2), 'hex') }); tx.sign(account.privateKey); - this.vm.runTx({tx: tx, skipBalance: true, skipNonce: true, enableHomestead: true}, cb); + var block = new EthJS.Block({ + header: { + // FIXME: support coinbase, difficulty, number and gasLimit + timestamp: new Date().getTime() / 1000 | 0 + } + }); + this.vm.runTx({block: block, tx: tx, skipBalance: true, skipNonce: true, enableHomestead: true}, cb); } catch (e) { cb( e, null ); }