aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-04-04 08:06:00 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-04-04 08:06:00 +0800
commit34e608e9dccb1248c3f55d8e4195d0a21267ed57 (patch)
treea74ccf1f938614fb62131dac1845a47fb843127d /app/scripts/lib
parentbf38aa6f1d793a0e18e64164a3a735e202ca34d6 (diff)
parentca780075a835172c60a47bac2681f4a893e1b515 (diff)
downloadtangerine-wallet-browser-34e608e9dccb1248c3f55d8e4195d0a21267ed57.tar.gz
tangerine-wallet-browser-34e608e9dccb1248c3f55d8e4195d0a21267ed57.tar.zst
tangerine-wallet-browser-34e608e9dccb1248c3f55d8e4195d0a21267ed57.zip
Merge branch 'master' of https://github.com/MetaMask/metamask-extension into cb-254
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/setupRaven.js2
-rw-r--r--app/scripts/lib/tx-state-manager.js12
2 files changed, 11 insertions, 3 deletions
diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js
index b93591e65..9ec9a256f 100644
--- a/app/scripts/lib/setupRaven.js
+++ b/app/scripts/lib/setupRaven.js
@@ -1,5 +1,5 @@
const Raven = require('raven-js')
-const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
+const METAMASK_DEBUG = process.env.METAMASK_DEBUG
const extractEthjsErrorMessage = require('./extractEthjsErrorMessage')
const PROD = 'https://3567c198f8a8412082d32655da2961d0@sentry.io/273505'
const DEV = 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496'
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index 23c915a61..9e597ef37 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/app/scripts/lib/tx-state-manager.js
@@ -140,8 +140,16 @@ module.exports = class TransactionStateManager extends EventEmitter {
validateTxParams(txParams) {
Object.keys(txParams).forEach((key) => {
const value = txParams[key]
- if (typeof value !== 'string') throw new Error(`${key}: ${value} in txParams is not a string`)
- if (!ethUtil.isHexPrefixed(value)) throw new Error('is not hex prefixed, everything on txParams must be hex prefixed')
+ // validate types
+ switch (key) {
+ case 'chainId':
+ if (typeof value !== 'number') throw new Error(`${key} in txParams is not a Number. got: (${value})`)
+ break
+ default:
+ if (typeof value !== 'string') throw new Error(`${key} in txParams is not a string. got: (${value})`)
+ if (!ethUtil.isHexPrefixed(value)) throw new Error(`${key} in txParams is not hex prefixed. got: (${value})`)
+ break
+ }
})
}