Support passing value with a transaction

pull/1/head
Alex Beregszaszi 9 years ago
parent f80e2fae69
commit 00c0d3f2bb
  1. 1
      assets/js/app.js
  2. 4
      assets/js/universal-dapp.js
  3. 4
      index.html

@ -672,6 +672,7 @@
vm: executionContext === 'vm',
removable: false,
getAddress: function(){ return $('#txorigin').val(); },
getValue: function(){ return $('#value').val(); },
removable_instances: true,
renderOutputModifier: function(contractName, $contractOutput) {
var contract = data.contracts[contractName];

@ -431,7 +431,7 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
data = '0x' + data;
var gas = self.options.getGas ? self.options.getGas : 1000000;
var value = self.options.getValue ? self.options.getValue : 0;
var value = self.options.getValue ? self.options.getValue() : 0;
if (!this.vm) {
var tx = {
@ -459,7 +459,7 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
gasPrice: 1,
gasLimit: 3000000000, //plenty
to: to,
value: value,
value: new this.BN(value, 10),
data: new Buffer(data.slice(2), 'hex')
});
tx.sign(account.privateKey);

@ -80,8 +80,8 @@
<div class="row hide">
<label for="gasPrice"><input type="number" id="gasPrice" value="0"> Gas Price</label>
</div>
<div class="row hide">
<label for="value"><input type="number" id="value" value="0"> Value</label>
<div class="row">
<label for="value"><input type="number" id="value" value="0"> Value (Wei)</label>
</div>
</div>
<div id="settingsView">

Loading…
Cancel
Save