Support block header parameters in VM mode (timestamp for now)

Fix https://github.com/chriseth/browser-solidity/issues/90
pull/1/head
Alex Beregszaszi 9 years ago
parent d12bfd7471
commit f5c9b020f0
  1. 8
      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 );
}

Loading…
Cancel
Save