diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2019-06-20 01:09:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-20 01:09:48 +0800 |
commit | 3e3deed4709a84c7877dcef846788f0dc648c013 (patch) | |
tree | 2e3db2c1de1d7a142ba080099e82aa585204ddf6 /app/scripts/controllers/transactions/lib | |
parent | 748801f4179d353959f40049cf6ca27851eebd0e (diff) | |
parent | 5cf5359e788d7c93495da2ace5c9f81648b67fea (diff) | |
download | tangerine-wallet-browser-3e3deed4709a84c7877dcef846788f0dc648c013.tar.gz tangerine-wallet-browser-3e3deed4709a84c7877dcef846788f0dc648c013.tar.zst tangerine-wallet-browser-3e3deed4709a84c7877dcef846788f0dc648c013.zip |
Merge pull request #6728 from MetaMask/i#6724
transactions - always hexprefix txParams on update; fixes #6724
Diffstat (limited to 'app/scripts/controllers/transactions/lib')
-rw-r--r-- | app/scripts/controllers/transactions/lib/util.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/scripts/controllers/transactions/lib/util.js b/app/scripts/controllers/transactions/lib/util.js index 84f7592a0..5a8a0cefe 100644 --- a/app/scripts/controllers/transactions/lib/util.js +++ b/app/scripts/controllers/transactions/lib/util.js @@ -17,8 +17,8 @@ module.exports = { // functions that handle normalizing of that key in txParams const normalizers = { - from: from => addHexPrefix(from).toLowerCase(), - to: to => addHexPrefix(to).toLowerCase(), + from: (from, LowerCase = true) => LowerCase ? addHexPrefix(from).toLowerCase() : addHexPrefix(from), + to: (to, LowerCase = true) => LowerCase ? addHexPrefix(to).toLowerCase() : addHexPrefix(to), nonce: nonce => addHexPrefix(nonce), value: value => addHexPrefix(value), data: data => addHexPrefix(data), @@ -31,11 +31,11 @@ const normalizers = { @param txParams {object} @returns {object} normalized txParams */ -function normalizeTxParams (txParams) { +function normalizeTxParams (txParams, LowerCase) { // apply only keys in the normalizers const normalizedTxParams = {} for (const key in normalizers) { - if (txParams[key]) normalizedTxParams[key] = normalizers[key](txParams[key]) + if (txParams[key]) normalizedTxParams[key] = normalizers[key](txParams[key], LowerCase) } return normalizedTxParams } |