aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-01-03 06:22:44 +0800
committerGitHub <noreply@github.com>2018-01-03 06:22:44 +0800
commit3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa (patch)
tree144ff875cf4eb3fdf592ce12e8d3e92c63f40829
parent9940ea71dfb2b1e478f134e7cd82fce0e134f071 (diff)
downloadtangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.tar
tangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.tar.gz
tangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.tar.bz2
tangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.tar.lz
tangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.tar.xz
tangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.tar.zst
tangerine-wallet-browser-3f6cef0b3f56edc8cc0b66403f23ae216de7bcfa.zip
tx-gas-utils - tx-param-validation - use more intuitive check
-rw-r--r--app/scripts/lib/tx-gas-utils.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scripts/lib/tx-gas-utils.js b/app/scripts/lib/tx-gas-utils.js
index c00323a64..bc891fc07 100644
--- a/app/scripts/lib/tx-gas-utils.js
+++ b/app/scripts/lib/tx-gas-utils.js
@@ -83,11 +83,11 @@ module.exports = class txProvideUtil {
async validateTxParams (txParams) {
if ('value' in txParams) {
const value = txParams.value.toString()
- if (value.indexOf('-') === 0) {
+ if (value.includes('-')) {
throw new Error(`Invalid transaction value of ${txParams.value} not a positive number.`)
}
- if (value.indexOf('.') >= 0) {
+ if (value.includes('.')) {
throw new Error(`Invalid transaction value of ${txParams.value} number must be in wei`)
}
}