aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-04-05 00:09:59 +0800
committerGitHub <noreply@github.com>2018-04-05 00:09:59 +0800
commit75de380d65a79848f6f4b2549798a58a5e1b60f0 (patch)
tree3a2ff6c83c7592e9ec6f428b8ba0133877a07249
parent9930f5996c31680de0ee2383d33ed6d065a12cd0 (diff)
parent6be7365dd1d41a455daf8963a35d9f75a76e9e9d (diff)
downloadtangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.tar
tangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.tar.gz
tangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.tar.bz2
tangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.tar.lz
tangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.tar.xz
tangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.tar.zst
tangerine-wallet-browser-75de380d65a79848f6f4b2549798a58a5e1b60f0.zip
Merge pull request #3868 from MetaMask/chainid-fix
tx - txParams - allow chainId to be a hex string
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/scripts/lib/tx-state-manager.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 479e422f2..20651dbad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Current Master
+- Fix overly strict validation where transactions were rejected with hex encoded "chainId"
+
## 4.5.1 Tue Apr 03 2018
- Fix default network (should be mainnet not Rinkeby)
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index 9e597ef37..2ab24d6a0 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/app/scripts/lib/tx-state-manager.js
@@ -143,7 +143,7 @@ module.exports = class TransactionStateManager extends EventEmitter {
// validate types
switch (key) {
case 'chainId':
- if (typeof value !== 'number') throw new Error(`${key} in txParams is not a Number. got: (${value})`)
+ if (typeof value !== 'number' && typeof value !== 'string') throw new Error(`${key} in txParams is not a Number or hex string. got: (${value})`)
break
default:
if (typeof value !== 'string') throw new Error(`${key} in txParams is not a string. got: (${value})`)