diff --git a/ui/app/pages/send/send-content/add-recipient/add-recipient.js b/ui/app/pages/send/send-content/add-recipient/add-recipient.js index 195da89cb..317d02b88 100644 --- a/ui/app/pages/send/send-content/add-recipient/add-recipient.js +++ b/ui/app/pages/send/send-content/add-recipient/add-recipient.js @@ -16,13 +16,11 @@ import { isValidDomainName, } from '../../../../helpers/utils/util'; -export function getToErrorObject(to, hasHexData = false, network) { +export function getToErrorObject(to, network) { let toError = null; if (!to) { - if (!hasHexData) { - toError = REQUIRED_ERROR; - } - } else if (!isValidAddress(to) && !toError) { + toError = REQUIRED_ERROR; + } else if (!isValidAddress(to)) { toError = isEthNetwork(network) ? INVALID_RECIPIENT_ADDRESS_ERROR : INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR; diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js index cdf1a0c36..d93cd3fe8 100644 --- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js +++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js @@ -30,12 +30,6 @@ describe('add-recipient utils', function () { }); }); - it('should return null if "to" is falsy and hexData is truthy', function () { - assert.deepStrictEqual(getToErrorObject(null, true), { - to: null, - }); - }); - it('should return an invalid recipient error if "to" is truthy but invalid', function () { assert.deepStrictEqual(getToErrorObject('mockInvalidTo'), { to: INVALID_RECIPIENT_ADDRESS_ERROR, diff --git a/ui/app/pages/send/send.component.js b/ui/app/pages/send/send.component.js index 98c3b6600..ffd305287 100644 --- a/ui/app/pages/send/send.component.js +++ b/ui/app/pages/send/send.component.js @@ -31,7 +31,6 @@ export default class SendTransactionScreen extends Component { gasLimit: PropTypes.string, gasPrice: PropTypes.string, gasTotal: PropTypes.string, - hasHexData: PropTypes.bool, history: PropTypes.object, network: PropTypes.string, primaryCurrency: PropTypes.string, @@ -234,7 +233,7 @@ export default class SendTransactionScreen extends Component { } validate(query) { - const { hasHexData, tokens, sendToken, network } = this.props; + const { tokens, sendToken, network } = this.props; const { internalSearch } = this.state; @@ -243,7 +242,7 @@ export default class SendTransactionScreen extends Component { return; } - const toErrorObject = getToErrorObject(query, hasHexData, network); + const toErrorObject = getToErrorObject(query, network); const toWarningObject = getToWarningObject(query, tokens, sendToken); this.setState({