aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-08-29 20:51:31 +0800
committerDan <danjm.com@gmail.com>2017-08-29 22:56:33 +0800
commitcd5861541c1cb871d5e3b606501931f2aee0d048 (patch)
tree944191dd0528f03b771c7c93ed2b7c5775bab879 /ui/app/components
parentcd351e8aef59f314c170d0436d98aaf111db1c00 (diff)
downloadtangerine-wallet-browser-cd5861541c1cb871d5e3b606501931f2aee0d048.tar.gz
tangerine-wallet-browser-cd5861541c1cb871d5e3b606501931f2aee0d048.tar.zst
tangerine-wallet-browser-cd5861541c1cb871d5e3b606501931f2aee0d048.zip
Use hex values only in send.js to handle limit and price; GasTooltip accepts and returns values as hex (allows user to enter floats)
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/gas-tooltip.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/ui/app/components/gas-tooltip.js b/ui/app/components/gas-tooltip.js
index 76edb9214..4b6472b44 100644
--- a/ui/app/components/gas-tooltip.js
+++ b/ui/app/components/gas-tooltip.js
@@ -22,7 +22,10 @@ function GasTooltip () {
GasTooltip.prototype.componentWillMount = function () {
const { gasPrice = 0, gasLimit = 0} = this.props
- this.setState({ gasPrice, gasLimit })
+ this.setState({
+ gasPrice: parseInt(gasPrice, 16) / 1000000000,
+ gasLimit: parseInt(gasLimit, 16),
+ })
}
GasTooltip.prototype.updateGasPrice = function (newPrice) {
@@ -30,7 +33,10 @@ GasTooltip.prototype.updateGasPrice = function (newPrice) {
const { gasLimit } = this.state
this.setState({ gasPrice: newPrice })
- onFeeChange({ gasLimit, gasPrice: newPrice })
+ onFeeChange({
+ gasLimit: gasLimit.toString(16),
+ gasPrice: (newPrice * 1000000000).toString(16)
+ })
}
GasTooltip.prototype.updateGasLimit = function (newLimit) {
@@ -38,7 +44,10 @@ GasTooltip.prototype.updateGasLimit = function (newLimit) {
const { gasPrice } = this.state
this.setState({ gasLimit: newLimit })
- onFeeChange({ gasLimit: newLimit, gasPrice })
+ onFeeChange({
+ gasLimit: newLimit.toString(16),
+ gasPrice: (gasPrice * 1000000000).toString(16)
+ })
}
GasTooltip.prototype.onClose = function (e) {
@@ -63,10 +72,9 @@ GasTooltip.prototype.render = function () {
]),
h(InputNumber, {
unitLabel: 'GWEI',
- step: 0.0001,
- min: 0.0000,
- placeholder: '0.0000',
- fixed: 4,
+ step: 1,
+ min: 0,
+ placeholder: '0',
initValue: gasPrice,
onChange: (newPrice) => this.updateGasPrice(newPrice),
}),