diff options
author | Esteban MIno <efmino@uc.cl> | 2018-08-08 07:12:16 +0800 |
---|---|---|
committer | Esteban MIno <efmino@uc.cl> | 2018-08-08 07:12:16 +0800 |
commit | 33357e3538b5157a852323d5f1e2db7f19b3303e (patch) | |
tree | 49a704bd6574d2e61c0e7803895234731dd549da /app/scripts/controllers | |
parent | 15ea8c04b28a9f89999c96caf188d157e5230a55 (diff) | |
download | tangerine-wallet-browser-33357e3538b5157a852323d5f1e2db7f19b3303e.tar.gz tangerine-wallet-browser-33357e3538b5157a852323d5f1e2db7f19b3303e.tar.zst tangerine-wallet-browser-33357e3538b5157a852323d5f1e2db7f19b3303e.zip |
refactor unused code
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r-- | app/scripts/controllers/preferences.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index a6530424d..4aa91534d 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -452,10 +452,12 @@ class PreferencesController { if (!rawAddress || !symbol || !decimals) throw new Error(`Cannot suggest token without address, symbol, and decimals`) if (!(symbol.length < 5)) throw new Error(`Invalid symbol ${symbol} more than four characters`) const numDecimals = parseInt(decimals, 10) - if (isNaN(numDecimals) || numDecimals > 18 || numDecimals < 0) throw new Error(`Invalid decimals ${decimals}`) + if (isNaN(numDecimals) || numDecimals > 36 || numDecimals < 0) { + throw new Error(`Invalid decimals ${decimals} must be at least 0, and not over 36`) + } if (!isValidAddress(rawAddress)) throw new Error(`Invalid address ${rawAddress}`) } - + /** * Subscription to network provider type. * |