aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/scripts/controllers/preferences.js6
-rw-r--r--old-ui/app/app.js2
-rw-r--r--ui/app/actions.js10
-rw-r--r--ui/app/components/pages/confirm-add-token/confirm-add-token.component.js4
-rw-r--r--ui/app/components/pages/confirm-add-token/confirm-add-token.container.js8
-rw-r--r--ui/app/reducers/metamask.js1
6 files changed, 13 insertions, 18 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.
*
diff --git a/old-ui/app/app.js b/old-ui/app/app.js
index f60ee5beb..9be21ebad 100644
--- a/old-ui/app/app.js
+++ b/old-ui/app/app.js
@@ -239,7 +239,7 @@ App.prototype.renderPrimary = function () {
return h(AddTokenScreen, {key: 'add-token'})
case 'add-suggested-token':
- log.debug('rendering add-token screen from unlock screen.')
+ log.debug('rendering add-suggested-token screen from unlock screen.')
return h(AddSuggestedTokenScreen, {key: 'add-suggested-token'})
case 'config':
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 5cc7dc2fa..d1168c168 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -1639,16 +1639,16 @@ function removeSuggestedTokens () {
}
}
-function clearPendingTokens () {
+function updateTokens (newTokens) {
return {
- type: actions.CLEAR_PENDING_TOKENS,
+ type: actions.UPDATE_TOKENS,
+ newTokens,
}
}
-function updateTokens (newTokens) {
+function clearPendingTokens () {
return {
- type: actions.UPDATE_TOKENS,
- newTokens,
+ type: actions.CLEAR_PENDING_TOKENS,
}
}
diff --git a/ui/app/components/pages/confirm-add-token/confirm-add-token.component.js b/ui/app/components/pages/confirm-add-token/confirm-add-token.component.js
index 0f27ceb53..65d654b92 100644
--- a/ui/app/components/pages/confirm-add-token/confirm-add-token.component.js
+++ b/ui/app/components/pages/confirm-add-token/confirm-add-token.component.js
@@ -90,9 +90,7 @@ export default class ConfirmAddToken extends Component {
type="default"
large
className="page-container__footer-button"
- onClick={() => {
- history.push(ADD_TOKEN_ROUTE)
- }}
+ onClick={() => history.push(ADD_TOKEN_ROUTE)}
>
{ this.context.t('back') }
</Button>
diff --git a/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js b/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js
index 500b406bb..0190024d9 100644
--- a/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js
+++ b/ui/app/components/pages/confirm-add-token/confirm-add-token.container.js
@@ -1,16 +1,12 @@
import { connect } from 'react-redux'
import ConfirmAddToken from './confirm-add-token.component'
-const extend = require('xtend')
-
const { addTokens, clearPendingTokens } = require('../../../actions')
const mapStateToProps = ({ metamask }) => {
- const { pendingTokens, suggestedTokens } = metamask
- const params = extend(pendingTokens, suggestedTokens)
-
+ const { pendingTokens } = metamask
return {
- pendingTokens: params,
+ pendingTokens,
}
}
diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js
index 9e472bc6f..3f1d3394f 100644
--- a/ui/app/reducers/metamask.js
+++ b/ui/app/reducers/metamask.js
@@ -29,7 +29,6 @@ function reduceMetamask (state, action) {
tokenExchangeRates: {},
tokens: [],
pendingTokens: {},
- suggestedTokens: {},
send: {
gasLimit: null,
gasPrice: null,