Converts custom token address to checksum version (#793)

This commit is contained in:
Agustin Pane 2020-04-27 06:51:04 -03:00 committed by GitHub
parent 8c91e021fd
commit f4cca4c416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import Img from '~/components/layout/Img'
import Paragraph from '~/components/layout/Paragraph' import Paragraph from '~/components/layout/Paragraph'
import Row from '~/components/layout/Row' import Row from '~/components/layout/Row'
import { type Token, type TokenProps } from '~/logic/tokens/store/model/token' import { type Token, type TokenProps } from '~/logic/tokens/store/model/token'
import { getWeb3 } from '~/logic/wallets/getWeb3'
import TokenPlaceholder from '~/routes/safe/components/Balances/assets/token_placeholder.svg' import TokenPlaceholder from '~/routes/safe/components/Balances/assets/token_placeholder.svg'
export const ADD_CUSTOM_TOKEN_ADDRESS_INPUT_TEST_ID = 'add-custom-token-address-input' export const ADD_CUSTOM_TOKEN_ADDRESS_INPUT_TEST_ID = 'add-custom-token-address-input'
@ -64,8 +65,9 @@ const AddCustomToken = (props: Props) => {
const [formValues, setFormValues] = useState(INITIAL_FORM_STATE) const [formValues, setFormValues] = useState(INITIAL_FORM_STATE)
const handleSubmit = (values) => { const handleSubmit = (values) => {
const address = getWeb3().utils.toChecksumAddress(values.address)
const token = { const token = {
address: values.address, address,
decimals: values.decimals, decimals: values.decimals,
symbol: values.symbol, symbol: values.symbol,
name: values.symbol, name: values.symbol,