1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00

Remove token contract validation step

This commit is contained in:
Dan Finlay 2017-06-27 15:49:57 -07:00
parent 307e967a0c
commit 8642feee09

View File

@ -142,13 +142,7 @@ AddTokenScreen.prototype.render = function () {
if (!valid) return if (!valid) return
const { address, symbol, decimals } = this.state const { address, symbol, decimals } = this.state
this.checkIfToken(address.trim()) this.props.dispatch(actions.addToken(address.trim(), symbol.trim(), decimals))
.then(() => {
this.props.dispatch(actions.addToken(address.trim(), symbol.trim(), decimals))
})
.catch((reason) => {
this.setState({ warning: 'Not a valid token address.' })
})
}, },
}, 'Add'), }, 'Add'),
]), ]),
@ -208,12 +202,6 @@ AddTokenScreen.prototype.validateInputs = function () {
return isValid return isValid
} }
AddTokenScreen.prototype.checkIfToken = async function (address) {
const contract = this.TokenContract.at(address)
const result = await contract.balance(address)
return result[0].toString()
}
AddTokenScreen.prototype.attemptToAutoFillTokenParams = async function (address) { AddTokenScreen.prototype.attemptToAutoFillTokenParams = async function (address) {
const contract = this.TokenContract.at(address) const contract = this.TokenContract.at(address)