From e1b78da3e6b45037f8b9dacc4385c02c6c892f7c Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 6 Oct 2016 13:03:01 -0700 Subject: [PATCH 1/7] Add custom gas field to send page --- app/scripts/lib/id-management.js | 7 + ui/app/components/pending-tx-details.js | 2 + ui/app/components/range-slider.js | 63 +++++++++ ui/app/send.js | 166 ++++++++++++++++++------ 4 files changed, 195 insertions(+), 43 deletions(-) create mode 100644 ui/app/components/range-slider.js diff --git a/app/scripts/lib/id-management.js b/app/scripts/lib/id-management.js index e250943a0..299998cee 100644 --- a/app/scripts/lib/id-management.js +++ b/app/scripts/lib/id-management.js @@ -7,6 +7,7 @@ */ const ethUtil = require('ethereumjs-util') +const BN = ethUtil.BN const Transaction = require('ethereumjs-tx') module.exports = IdManagement @@ -24,7 +25,13 @@ function IdManagement (opts) { } this.signTx = function (txParams) { + // calculate gas with custom gas multiplier + var gasMultiplier = txParams.gasMultiplier || 1 + delete txParams.gasMultiplier + var gasPrice = parseFloat(new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16).toString()) * gasMultiplier + txParams.gasPrice = ethUtil.intToHex(parseInt(gasPrice)) // normalize values + txParams.to = ethUtil.addHexPrefix(txParams.to) txParams.from = ethUtil.addHexPrefix(txParams.from) txParams.value = ethUtil.addHexPrefix(txParams.value) diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index d8e8524bf..7fa3d6ddd 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -29,8 +29,10 @@ PTXP.render = function () { var account = props.accounts[address] var balance = account ? account.balance : '0x0' + var gasMultiplier = txParams.gasMultiplier var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16) var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16) + gasPrice = new BN(parseFloat(gasPrice.toString()) * gasMultiplier) var txFee = gasCost.mul(gasPrice) var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16) var maxCost = txValue.add(txFee) diff --git a/ui/app/components/range-slider.js b/ui/app/components/range-slider.js new file mode 100644 index 000000000..6ca6e434e --- /dev/null +++ b/ui/app/components/range-slider.js @@ -0,0 +1,63 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits + +module.exports = RangeSlider + +inherits(RangeSlider, Component) +function RangeSlider () { + Component.call(this) +} + +RangeSlider.prototype.render = function () { + const props = this.props + const onChange = props.onChange || function () {} + const name = props.name + const { + min = 0, + max = 100, + increment = 1, + defaultValue = 50, + mirrorInput = false, + } = this.props.options + const {container, input, range} = props.style + + return ( + h('.flex-row', { + style: container, + }, [ + h('input', { + type: 'range', + name: name, + min: min, + max: max, + step: increment, + style: range, + defaultValue: defaultValue, + onChange: mirrorInput ? this.mirrorInputs.bind(this, name) : onChange, + }), + + // Mirrored input for range + mirrorInput ? h('input.large-input', { + type: 'number', + name: `${name}Mirror`, + min: min, + max: max, + defaultValue: defaultValue, + step: increment, + style: input, + onChange: this.mirrorInputs.bind(this, `${name}Mirror`), + }) : null, + ]) + ) +} + +RangeSlider.prototype.mirrorInputs = function (active) { + var range = document.querySelector(`input[name="${this.props.name}"]`) + var inputMirror = document.querySelector(`input[name="${this.props.name}Mirror"]`) + if (active === this.props.name) { + inputMirror.value = range.value + } else { + range.value = inputMirror.value + } +} diff --git a/ui/app/send.js b/ui/app/send.js index 009866cf7..d10c658e3 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -9,7 +9,8 @@ const numericBalance = require('./util').numericBalance const addressSummary = require('./util').addressSummary const EthBalance = require('./components/eth-balance') const ethUtil = require('ethereumjs-util') - +const RangeSlider = require('./components/range-slider') +const Tooltip = require('./components/tooltip') module.exports = connect(mapStateToProps)(SendTransactionScreen) function mapStateToProps (state) { @@ -50,7 +51,7 @@ SendTransactionScreen.prototype.render = function () { // Sender Profile // - h('.account-data-subsection.flex-column.flex-grow', { + h('.account-data-subsection.flex-row.flex-grow', { style: { margin: '0 20px', }, @@ -59,10 +60,9 @@ SendTransactionScreen.prototype.render = function () { // header - identicon + nav h('.flex-row.flex-space-between', { style: { - marginTop: 28, + marginTop: '15px', }, }, [ - // back button h('i.fa.fa-arrow-left.fa-lg.cursor-pointer.color-orange', { onClick: this.back.bind(this), @@ -77,42 +77,53 @@ SendTransactionScreen.prototype.render = function () { ]), // invisible place holder - h('i.fa.fa-users.fa-lg.invisible'), - - ]), - - // account label - h('h2.font-medium.color-forest.flex-center', { - style: { - paddingTop: 8, - marginBottom: 8, - }, - }, identity && identity.name), - - // address and getter actions - h('.flex-row.flex-center', { - style: { - marginBottom: 8, - }, - }, [ - - h('div', { + h('i.fa.fa-users.fa-lg.invisible', { style: { - lineHeight: '16px', + marginTop: '28px', }, - }, addressSummary(address)), - - ]), - - // balance - h('.flex-row.flex-center', [ - - h(EthBalance, { - value: account && account.balance, }), ]), + // account label + + h('.flex-column', { + style: { + marginTop: '10px', + alignItems: 'flex-start', + }, + }, [ + h('h2.font-medium.color-forest.flex-center', { + style: { + paddingTop: '8px', + marginBottom: '8px', + }, + }, identity && identity.name), + + // address and getter actions + h('.flex-row.flex-center', { + style: { + marginBottom: '8px', + }, + }, [ + + h('div', { + style: { + lineHeight: '16px', + }, + }, addressSummary(address)), + + ]), + + // balance + h('.flex-row.flex-center', [ + + h(EthBalance, { + value: account && account.balance, + }), + + ]), + ]), ]), // @@ -123,8 +134,8 @@ SendTransactionScreen.prototype.render = function () { style: { background: '#EBEBEB', color: '#AEAEAE', - marginTop: 32, - marginBottom: 16, + marginTop: '15px', + marginBottom: '16px', }, }, [ 'Send Transaction', @@ -152,7 +163,7 @@ SendTransactionScreen.prototype.render = function () { placeholder: 'Amount', type: 'number', style: { - marginRight: 6, + marginRight: '6px', }, dataset: { persistentFormId: 'tx-amount', @@ -171,20 +182,19 @@ SendTransactionScreen.prototype.render = function () { // // Optional Fields // - h('h3.flex-center.text-transform-uppercase', { style: { background: '#EBEBEB', color: '#AEAEAE', - marginTop: 16, - marginBottom: 16, + marginTop: '16px', + marginBottom: '16px', }, }, [ 'Transactional Data (optional)', ]), // 'data' field - h('section.flex-row.flex-center', [ + h('section.flex-column.flex-center', [ h('input.large-input', { name: 'txData', placeholder: '0x01234', @@ -197,6 +207,75 @@ SendTransactionScreen.prototype.render = function () { }, }), ]), + // custom gas field + h('h3.flex-center.text-transform-uppercase', { + style: { + background: '#EBEBEB', + color: '#AEAEAE', + marginBottom: '5px', + }, + }, [ + 'Transaction Fee (optional)', + h(Tooltip, { + title: ` + This is used to set the transactions + gas price. seting it to 100% will use + the full recomend value. + `, + }, [ + h('i.fa.fa-question-circle', { + style: { + marginLeft: '5px', + }, + }), + ]), + ]), + + h('section.flex-column.flex-center', [ + h('.flex-row', [ + h(RangeSlider, { + name: 'gasInput', + options: { + mirrorInput: true, + defaultValue: 100, + min: 80, + max: 220, + }, + style: { + container: { + marginBottom: '16px', + }, + range: { + width: '68vw', + }, + input: { + width: '5em', + marginLeft: '5px', + }, + }, + }), + + h('div', { + style: { + fontSize: '12px', + paddingTop: '8px', + paddingLeft: '5px', + }, + }, '%'), + ]), + h('.flex-row', { + style: { + justifyContent: 'space-between', + width: '243px', + position: 'relative', + fontSize: '12px', + right: '42px', + bottom: '30px', + }, + }, [ + h('span', 'Cheaper'), h('span', 'Faster'), + ]), + ]), ]) ) } @@ -211,11 +290,12 @@ SendTransactionScreen.prototype.back = function () { this.props.dispatch(actions.backToAccountDetail(address)) } -SendTransactionScreen.prototype.onSubmit = function () { +SendTransactionScreen.prototype.onSubmit = function (gasPrice) { const recipient = document.querySelector('input[name="address"]').value const input = document.querySelector('input[name="amount"]').value const value = util.normalizeEthStringToWei(input) const txData = document.querySelector('input[name="txData"]').value + const gasMultiplier = document.querySelector('input[name="gasInput"]').value const balance = this.props.balance let message @@ -243,6 +323,6 @@ SendTransactionScreen.prototype.onSubmit = function () { if (recipient) txParams.to = ethUtil.addHexPrefix(recipient) if (txData) txParams.data = txData - + txParams.gasMultiplier = gasMultiplier * 0.01 this.props.dispatch(actions.signTx(txParams)) } From 97970e803d55fc8a578a3a9e6d6f3ab19c332b4b Mon Sep 17 00:00:00 2001 From: Frankie Date: Mon, 10 Oct 2016 18:19:45 -0700 Subject: [PATCH 2/7] Add to CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd1d682ec..2629cf592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Add a custom transaction fee field to send form. + ## 2.13.3 2016-10-4 - Fix bug where log queries were filtered out. From c400f7c0f6bff13400eedcd80fdc83e572eb42a8 Mon Sep 17 00:00:00 2001 From: Frankie Date: Wed, 12 Oct 2016 19:35:09 -0700 Subject: [PATCH 3/7] Fix gasPrice range --- app/scripts/lib/config-manager.js | 12 ++++++++++++ app/scripts/lib/id-management.js | 8 ++++---- app/scripts/lib/idStore.js | 4 ++++ app/scripts/metamask-controller.js | 5 +++++ ui/app/actions.js | 2 +- ui/app/components/pending-tx-details.js | 4 ++-- ui/app/components/range-slider.js | 19 +++++++------------ ui/app/send.js | 3 ++- 8 files changed, 37 insertions(+), 20 deletions(-) diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index ecc9bc5f7..cced32670 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -384,3 +384,15 @@ ConfigManager.prototype.createShapeShiftTx = function (depositAddress, depositTy } this.setData(data) } + +ConfigManager.prototype.getGasMultiplier = function () { + var data = this.getData() + return ('gasMultiplier' in data) && data.gasMultiplier +} + +ConfigManager.prototype.setGasMultiplier = function (gasMultiplier) { + var data = this.getData() + + data.gasMultiplier = gasMultiplier + this.setData(data) +} diff --git a/app/scripts/lib/id-management.js b/app/scripts/lib/id-management.js index 2a985265c..002f03047 100644 --- a/app/scripts/lib/id-management.js +++ b/app/scripts/lib/id-management.js @@ -26,10 +26,10 @@ function IdManagement (opts) { this.signTx = function (txParams) { // calculate gas with custom gas multiplier - var gasMultiplier = txParams.gasMultiplier || 1 - delete txParams.gasMultiplier - var gasPrice = parseFloat(new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16).toString()) * gasMultiplier - txParams.gasPrice = ethUtil.intToHex(parseInt(gasPrice)) + var gasMultiplier = this.configManager.getGasMultiplier() || 1 + var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16) + gasPrice = gasPrice.mul(new BN(gasMultiplier * 100)).div(new BN(100, 10)) + txParams.gasPrice = ethUtil.intToHex(gasPrice.toNumber()) // normalize values txParams.to = ethUtil.addHexPrefix(txParams.to) diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 6837a1e8d..aa77c3360 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -112,6 +112,8 @@ IdentityStore.prototype.getState = function () { currentFiat: configManager.getCurrentFiat(), conversionRate: configManager.getConversionRate(), conversionDate: configManager.getConversionDate(), + gasMultiplier: configManager.getGasMultiplier(), + })) } @@ -211,6 +213,7 @@ IdentityStore.prototype.exportAccount = function (address, cb) { // comes from dapp via zero-client hooked-wallet provider IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDoneCb, cb) { const configManager = this.configManager + var self = this // create txData obj with parameters and meta data var time = (new Date()).getTime() @@ -222,6 +225,7 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone txParams: txParams, time: time, status: 'unconfirmed', + gasMultiplier: configManager.getGasMultiplier() || 1, } console.log('addUnconfirmedTransaction:', txData) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 550531d6e..c0168903d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -55,6 +55,7 @@ module.exports = class MetamaskController { agreeToEthWarning: this.agreeToEthWarning.bind(this), setTOSHash: this.setTOSHash.bind(this), checkTOSChange: this.checkTOSChange.bind(this), + setGasMultiplier: this.setGasMultiplier.bind(this), // forward directly to idStore createNewVault: idStore.createNewVault.bind(idStore), @@ -377,4 +378,8 @@ module.exports = class MetamaskController { createShapeShiftTx (depositAddress, depositType) { this.configManager.createShapeShiftTx(depositAddress, depositType) } + + setGasMultiplier (gasMultiplier) { + this.configManager.setGasMultiplier(gasMultiplier) + } } diff --git a/ui/app/actions.js b/ui/app/actions.js index 0cce9065e..9cacadc0d 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -277,10 +277,10 @@ function signMsg (msgData) { } function signTx (txData) { + _accountManager.setGasMultiplier(txData.gasMultiplier) return (dispatch) => { web3.eth.sendTransaction(txData, (err, data) => { dispatch(actions.hideLoadingIndication()) - if (err) return dispatch(actions.displayWarning(err.message)) dispatch(actions.hideWarning()) dispatch(actions.goHome()) diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index 7fa3d6ddd..0f7e20613 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -29,10 +29,10 @@ PTXP.render = function () { var account = props.accounts[address] var balance = account ? account.balance : '0x0' - var gasMultiplier = txParams.gasMultiplier + var gasMultiplier = txData.gasMultiplier var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16) var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16) - gasPrice = new BN(parseFloat(gasPrice.toString()) * gasMultiplier) + gasPrice = gasPrice.mul(new BN(gasMultiplier * 100)).div(new BN(100, 10)) var txFee = gasCost.mul(gasPrice) var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16) var maxCost = txValue.add(txFee) diff --git a/ui/app/components/range-slider.js b/ui/app/components/range-slider.js index 6ca6e434e..cc1de1ce5 100644 --- a/ui/app/components/range-slider.js +++ b/ui/app/components/range-slider.js @@ -10,8 +10,9 @@ function RangeSlider () { } RangeSlider.prototype.render = function () { + const state = this.state || {} const props = this.props - const onChange = props.onChange || function () {} + const onInput = props.onInput || function () {} const name = props.name const { min = 0, @@ -33,8 +34,8 @@ RangeSlider.prototype.render = function () { max: max, step: increment, style: range, - defaultValue: defaultValue, - onChange: mirrorInput ? this.mirrorInputs.bind(this, name) : onChange, + value: state.value || defaultValue, + onChange: mirrorInput ? this.mirrorInputs.bind(this, name) : onInput, }), // Mirrored input for range @@ -43,7 +44,7 @@ RangeSlider.prototype.render = function () { name: `${name}Mirror`, min: min, max: max, - defaultValue: defaultValue, + value: state.value || defaultValue, step: increment, style: input, onChange: this.mirrorInputs.bind(this, `${name}Mirror`), @@ -52,12 +53,6 @@ RangeSlider.prototype.render = function () { ) } -RangeSlider.prototype.mirrorInputs = function (active) { - var range = document.querySelector(`input[name="${this.props.name}"]`) - var inputMirror = document.querySelector(`input[name="${this.props.name}Mirror"]`) - if (active === this.props.name) { - inputMirror.value = range.value - } else { - range.value = inputMirror.value - } +RangeSlider.prototype.mirrorInputs = function (active, event) { + this.setState({value: event.target.value}) } diff --git a/ui/app/send.js b/ui/app/send.js index d10c658e3..01c9314ce 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -319,10 +319,11 @@ SendTransactionScreen.prototype.onSubmit = function (gasPrice) { var txParams = { from: this.props.address, value: '0x' + value.toString(16), + gasMultiplier: gasMultiplier * 0.01, } if (recipient) txParams.to = ethUtil.addHexPrefix(recipient) if (txData) txParams.data = txData - txParams.gasMultiplier = gasMultiplier * 0.01 + this.props.dispatch(actions.signTx(txParams)) } From 67eba9f542588f13d37aa5e10c659c93d6e58dc1 Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 13 Oct 2016 16:04:23 -0700 Subject: [PATCH 4/7] Specify base 10 in bignumber --- app/scripts/lib/id-management.js | 2 +- ui/app/components/pending-tx-details.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/id-management.js b/app/scripts/lib/id-management.js index 002f03047..421f2105f 100644 --- a/app/scripts/lib/id-management.js +++ b/app/scripts/lib/id-management.js @@ -28,7 +28,7 @@ function IdManagement (opts) { // calculate gas with custom gas multiplier var gasMultiplier = this.configManager.getGasMultiplier() || 1 var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice), 16) - gasPrice = gasPrice.mul(new BN(gasMultiplier * 100)).div(new BN(100, 10)) + gasPrice = gasPrice.mul(new BN(gasMultiplier * 100, 10)).div(new BN(100, 10)) txParams.gasPrice = ethUtil.intToHex(gasPrice.toNumber()) // normalize values diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index 0f7e20613..545302098 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -32,7 +32,7 @@ PTXP.render = function () { var gasMultiplier = txData.gasMultiplier var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16) var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16) - gasPrice = gasPrice.mul(new BN(gasMultiplier * 100)).div(new BN(100, 10)) + gasPrice = gasPrice.mul(new BN(gasMultiplier * 100), 10).div(new BN(100, 10)) var txFee = gasCost.mul(gasPrice) var txValue = new BN(ethUtil.stripHexPrefix(txParams.value || '0x0'), 16) var maxCost = txValue.add(txFee) From 328f8b0cac1e19a2f27ca0272930e393b1e9dc8d Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 13 Oct 2016 16:22:45 -0700 Subject: [PATCH 5/7] fix spelling --- ui/app/send.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/app/send.js b/ui/app/send.js index 01c9314ce..323ddb5e3 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -218,10 +218,8 @@ SendTransactionScreen.prototype.render = function () { 'Transaction Fee (optional)', h(Tooltip, { title: ` - This is used to set the transactions - gas price. seting it to 100% will use - the full recomend value. - `, + This is used to set the transaction's gas price. + Setting it to 100% will use the full recommended value. `, }, [ h('i.fa.fa-question-circle', { style: { From aace26c4bda151c71f9f8c73669e789ac258e9ee Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 13 Oct 2016 16:53:32 -0700 Subject: [PATCH 6/7] Create callback and Clean-up details --- app/scripts/metamask-controller.js | 9 +++++++-- ui/app/actions.js | 14 ++++++++------ ui/app/components/range-slider.js | 6 +++--- ui/app/send.js | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c48a4c569..38c8b21af 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -379,7 +379,12 @@ module.exports = class MetamaskController { this.configManager.createShapeShiftTx(depositAddress, depositType) } - setGasMultiplier (gasMultiplier) { - this.configManager.setGasMultiplier(gasMultiplier) + setGasMultiplier (gasMultiplier, cb) { + try{ + this.configManager.setGasMultiplier(gasMultiplier) + cb() + } catch (e) { + cb(e) + } } } diff --git a/ui/app/actions.js b/ui/app/actions.js index 9cacadc0d..1f0d8fc78 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -277,15 +277,17 @@ function signMsg (msgData) { } function signTx (txData) { - _accountManager.setGasMultiplier(txData.gasMultiplier) return (dispatch) => { - web3.eth.sendTransaction(txData, (err, data) => { - dispatch(actions.hideLoadingIndication()) + _accountManager.setGasMultiplier(txData.gasMultiplier, (err) => { if (err) return dispatch(actions.displayWarning(err.message)) - dispatch(actions.hideWarning()) - dispatch(actions.goHome()) + web3.eth.sendTransaction(txData, (err, data) => { + dispatch(actions.hideLoadingIndication()) + if (err) return dispatch(actions.displayWarning(err.message)) + dispatch(actions.hideWarning()) + dispatch(actions.goHome()) + }) + dispatch(this.showConfTxPage()) }) - dispatch(this.showConfTxPage()) } } diff --git a/ui/app/components/range-slider.js b/ui/app/components/range-slider.js index cc1de1ce5..823f5eb01 100644 --- a/ui/app/components/range-slider.js +++ b/ui/app/components/range-slider.js @@ -35,7 +35,7 @@ RangeSlider.prototype.render = function () { step: increment, style: range, value: state.value || defaultValue, - onChange: mirrorInput ? this.mirrorInputs.bind(this, name) : onInput, + onChange: mirrorInput ? this.mirrorInputs.bind(this, event) : onInput, }), // Mirrored input for range @@ -47,12 +47,12 @@ RangeSlider.prototype.render = function () { value: state.value || defaultValue, step: increment, style: input, - onChange: this.mirrorInputs.bind(this, `${name}Mirror`), + onChange: this.mirrorInputs.bind(this, event), }) : null, ]) ) } -RangeSlider.prototype.mirrorInputs = function (active, event) { +RangeSlider.prototype.mirrorInputs = function (event) { this.setState({value: event.target.value}) } diff --git a/ui/app/send.js b/ui/app/send.js index 323ddb5e3..97ed29e4a 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -207,7 +207,7 @@ SendTransactionScreen.prototype.render = function () { }, }), ]), - // custom gas field + // custom gasPrice field h('h3.flex-center.text-transform-uppercase', { style: { background: '#EBEBEB', From 35232c5e293b30da90049b094d87336bb22dc59e Mon Sep 17 00:00:00 2001 From: Frankie Date: Thu, 13 Oct 2016 18:08:15 -0700 Subject: [PATCH 7/7] Fix for linting --- app/scripts/metamask-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 38c8b21af..8b593d820 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -380,7 +380,7 @@ module.exports = class MetamaskController { } setGasMultiplier (gasMultiplier, cb) { - try{ + try { this.configManager.setGasMultiplier(gasMultiplier) cb() } catch (e) {