aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx-details.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-02 09:03:55 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-02 09:03:55 +0800
commit72932bdcba10bd9d47724f271d0c14f84d12b759 (patch)
treeb1426b18930b61d6f24031372f1a91f7375a4c47 /ui/app/components/pending-tx-details.js
parent0ac1f749fd68244682d0f2c763028cdf6aa29486 (diff)
downloadtangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.tar
tangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.tar.gz
tangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.tar.bz2
tangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.tar.lz
tangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.tar.xz
tangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.tar.zst
tangerine-wallet-browser-72932bdcba10bd9d47724f271d0c14f84d12b759.zip
Prevent submission of invalid gas parameters.
Diffstat (limited to 'ui/app/components/pending-tx-details.js')
-rw-r--r--ui/app/components/pending-tx-details.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js
index fc8d65454..e92ce575f 100644
--- a/ui/app/components/pending-tx-details.js
+++ b/ui/app/components/pending-tx-details.js
@@ -306,7 +306,6 @@ PTXP.gatherParams = function () {
const state = this.state || {}
const txData = state.txData || props.txData
const txParams = txData.txParams
-
const gas = state.gas || txParams.gas
const gasPrice = state.gasPrice || txParams.gasPrice
const resultTx = extend(txParams, {
@@ -320,6 +319,16 @@ PTXP.gatherParams = function () {
return resultTxMeta
}
+PTXP.verifyGasParams = function () {
+ // We call this in case the gas has not been modified at all
+ if (!this.state) { return true }
+ return this._notZeroOrEmptyString(this.state.gas) && this._notZeroOrEmptyString(this.state.gasPrice)
+}
+
+PTXP._notZeroOrEmptyString = function (obj) {
+ return obj !== '' && obj !== '0x0'
+}
+
function forwardCarrat () {
return (