aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-content/send-to-row/send-to-row.utils.js
diff options
context:
space:
mode:
authorJonathan Smirnoff <7558841+jonathansmirnoff@users.noreply.github.com>2019-02-14 04:30:46 +0800
committerFrankie <frankie.diamond@gmail.com>2019-02-14 04:30:46 +0800
commit8dddf48904323d47685516ccc76f9e267dbd188a (patch)
tree3e1c11920da2be888271e4bc48d8dce61e64b944 /ui/app/components/send/send-content/send-to-row/send-to-row.utils.js
parentf7ab4577f637dd9e96cec0f08848bc70c489f9d3 (diff)
downloadtangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.tar
tangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.tar.gz
tangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.tar.bz2
tangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.tar.lz
tangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.tar.xz
tangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.tar.zst
tangerine-wallet-browser-8dddf48904323d47685516ccc76f9e267dbd188a.zip
Fixed issue #5838 (#6001)
Update changelog file
Diffstat (limited to 'ui/app/components/send/send-content/send-to-row/send-to-row.utils.js')
-rw-r--r--ui/app/components/send/send-content/send-to-row/send-to-row.utils.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/app/components/send/send-content/send-to-row/send-to-row.utils.js b/ui/app/components/send/send-content/send-to-row/send-to-row.utils.js
index 4a8add42e..2bd3ea45e 100644
--- a/ui/app/components/send/send-content/send-to-row/send-to-row.utils.js
+++ b/ui/app/components/send/send-content/send-to-row/send-to-row.utils.js
@@ -2,20 +2,21 @@ const {
REQUIRED_ERROR,
INVALID_RECIPIENT_ADDRESS_ERROR,
KNOWN_RECIPIENT_ADDRESS_ERROR,
+ INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR,
} = require('../../send.constants')
-const { isValidAddress } = require('../../../../util')
+const { isValidAddress, isEthNetwork } = require('../../../../util')
import { checkExistingAddresses } from '../../../pages/add-token/util'
const ethUtil = require('ethereumjs-util')
const contractMap = require('eth-contract-metadata')
-function getToErrorObject (to, toError = null, hasHexData = false, tokens = [], selectedToken = null) {
+function getToErrorObject (to, toError = null, hasHexData = false, tokens = [], selectedToken = null, network) {
if (!to) {
if (!hasHexData) {
toError = REQUIRED_ERROR
}
- } else if (!isValidAddress(to) && !toError) {
- toError = INVALID_RECIPIENT_ADDRESS_ERROR
+ } else if (!isValidAddress(to, network) && !toError) {
+ toError = isEthNetwork(network) ? INVALID_RECIPIENT_ADDRESS_ERROR : INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR
} else if (selectedToken && (ethUtil.toChecksumAddress(to) in contractMap || checkExistingAddresses(to, tokens))) {
toError = KNOWN_RECIPIENT_ADDRESS_ERROR
}