From 2c6670600070f49551fa2bd2cd1f4bba6fe406b9 Mon Sep 17 00:00:00 2001 From: d11e9 Date: Fri, 9 Oct 2015 16:01:37 +0100 Subject: [PATCH] tx panel --- assets/css/browser-solidity.css | 25 +++++++++------------- assets/js/universal-dapp.js | 9 ++++++-- index.html | 38 ++++++++++++++++++++++----------- 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/assets/css/browser-solidity.css b/assets/css/browser-solidity.css index 5ab7cb2b25..efe7286c28 100644 --- a/assets/css/browser-solidity.css +++ b/assets/css/browser-solidity.css @@ -139,16 +139,25 @@ body { #header #optionViews { clear: both; overflow: auto; - padding: 1em; } #header #optionViews > div { display: none; + padding: 0.4em; } #header #optionViews.txView #txView { display: block; } #header #optionViews.settingsView #settingsView { display: block; } #header #optionViews.publishView #publishView { display: block; } #header #optionViews.envView #envView { display: block; } +#header #optionViews.txView input, +#header #optionViews.txView select { + max-width: 13em; + padding: 0.3em; + box-sizing: border-box; + border: 1px solid rgba( 0,0,0,0.3 ); + border-radius: 3px; +} + #header .info { font-family: monospace; min-height: 6em; @@ -172,29 +181,15 @@ body { #header .origin, #header #executionContext { display: block; - margin-top: 0.5em; word-wrap: break-word; } -#header #executionContext{ margin-top: 0; } - - #header #versionSelector { border: 0 none; font-family: monospace; background-color: transparent; } - - - - - - - - - - .col1 { width: 30%; float: left; diff --git a/assets/js/universal-dapp.js b/assets/js/universal-dapp.js index b052635e81..e597a9b197 100644 --- a/assets/js/universal-dapp.js +++ b/assets/js/universal-dapp.js @@ -382,6 +382,9 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { var to = args.address; var constant = args.abi.constant; var isConstructor = args.bytecode !== undefined; + + var gas = self.options.getGas ? self.options.getGas : 1000000; + var value = self.options.getValue ? self.options.getValue : 0; if (!this.vm) { if (constant && !isConstructor) { @@ -389,10 +392,11 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { func[args.abi.name].call( cb ); } else { var tx = { - from: web3.eth.accounts[0], + from: self.options.getAddress ? self.options.getAddress() : web3.eth.accounts[0], to: to, data: data, - gas: 1000000 + gas: gas, + value: value }; web3.eth.estimateGas( tx, function(err, resp){ tx.gas = resp; @@ -409,6 +413,7 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { gasPrice: '01', gasLimit: '3000000000', //plenty to: to, + value: value, data: data }); tx.sign(new Buffer(this.secretKey, 'hex')); diff --git a/index.html b/index.html index 9283dfced4..753d845143 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@ THE SOFTWARE.