diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-06-06 07:26:49 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-06-06 07:26:49 +0800 |
commit | deb882bd6e49d71f5ecee8c170a5412ad5e78bec (patch) | |
tree | 94b0c57f070db6c6981f1a785878d7b93c00c018 /ui/app/components/pending-tx.js | |
parent | 0fb38632befc8a09dc12de8f609edfb0ffab9d35 (diff) | |
parent | 29c7739efce215f94759295b89c7b46828badb12 (diff) | |
download | tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.tar tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.tar.gz tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.tar.bz2 tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.tar.lz tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.tar.xz tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.tar.zst tangerine-wallet-browser-deb882bd6e49d71f5ecee8c170a5412ad5e78bec.zip |
Merge branch 'master' into currency-fix
Diffstat (limited to 'ui/app/components/pending-tx.js')
-rw-r--r-- | ui/app/components/pending-tx.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 4961db5de..e3b307b0b 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -7,11 +7,10 @@ const clone = require('clone') const ethUtil = require('ethereumjs-util') const BN = ethUtil.BN const hexToBn = require('../../../app/scripts/lib/hex-to-bn') - +const util = require('../util') const MiniAccountPanel = require('./mini-account-panel') const Copyable = require('./copyable') const EthBalance = require('./eth-balance') -const util = require('../util') const addressSummary = util.addressSummary const nameForAddress = require('../../lib/contract-namer') const BNInput = require('./bn-as-decimal-input') @@ -45,6 +44,9 @@ PendingTx.prototype.render = function () { const account = props.accounts[address] const balance = account ? account.balance : '0x0' + // recipient check + const isValidAddress = !txParams.to || util.isValidAddress(txParams.to) + // Gas const gas = txParams.gas const gasBn = hexToBn(gas) @@ -267,6 +269,15 @@ PendingTx.prototype.render = function () { }, 'Transaction Error. Exception thrown in contract code.') : null, + !isValidAddress ? + h('.error', { + style: { + marginLeft: 50, + fontSize: '0.9em', + }, + }, 'Recipient address is invalid. Sending this transaction will result in a loss of ETH.') + : null, + insufficientBalance ? h('span.error', { style: { @@ -304,7 +315,7 @@ PendingTx.prototype.render = function () { type: 'submit', value: 'ACCEPT', style: { marginLeft: '10px' }, - disabled: insufficientBalance || !this.state.valid, + disabled: insufficientBalance || !this.state.valid || !isValidAddress, }), h('button.cancel.btn-red', { |