Remove unused `hasHexData` prop (#10529)

This prop was never passed in, nor can I see any reason for it to exist
in the first place.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent b74b70df2a
commit 1ed75b45f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ui/app/pages/send/send-content/add-recipient/add-recipient.js
  2. 6
      ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js
  3. 5
      ui/app/pages/send/send.component.js

@ -16,13 +16,11 @@ import {
isValidDomainName, isValidDomainName,
} from '../../../../helpers/utils/util'; } from '../../../../helpers/utils/util';
export function getToErrorObject(to, hasHexData = false, network) { export function getToErrorObject(to, network) {
let toError = null; let toError = null;
if (!to) { if (!to) {
if (!hasHexData) { toError = REQUIRED_ERROR;
toError = REQUIRED_ERROR; } else if (!isValidAddress(to)) {
}
} else if (!isValidAddress(to) && !toError) {
toError = isEthNetwork(network) toError = isEthNetwork(network)
? INVALID_RECIPIENT_ADDRESS_ERROR ? INVALID_RECIPIENT_ADDRESS_ERROR
: INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR; : INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR;

@ -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 () { it('should return an invalid recipient error if "to" is truthy but invalid', function () {
assert.deepStrictEqual(getToErrorObject('mockInvalidTo'), { assert.deepStrictEqual(getToErrorObject('mockInvalidTo'), {
to: INVALID_RECIPIENT_ADDRESS_ERROR, to: INVALID_RECIPIENT_ADDRESS_ERROR,

@ -31,7 +31,6 @@ export default class SendTransactionScreen extends Component {
gasLimit: PropTypes.string, gasLimit: PropTypes.string,
gasPrice: PropTypes.string, gasPrice: PropTypes.string,
gasTotal: PropTypes.string, gasTotal: PropTypes.string,
hasHexData: PropTypes.bool,
history: PropTypes.object, history: PropTypes.object,
network: PropTypes.string, network: PropTypes.string,
primaryCurrency: PropTypes.string, primaryCurrency: PropTypes.string,
@ -234,7 +233,7 @@ export default class SendTransactionScreen extends Component {
} }
validate(query) { validate(query) {
const { hasHexData, tokens, sendToken, network } = this.props; const { tokens, sendToken, network } = this.props;
const { internalSearch } = this.state; const { internalSearch } = this.state;
@ -243,7 +242,7 @@ export default class SendTransactionScreen extends Component {
return; return;
} }
const toErrorObject = getToErrorObject(query, hasHexData, network); const toErrorObject = getToErrorObject(query, network);
const toWarningObject = getToWarningObject(query, tokens, sendToken); const toWarningObject = getToWarningObject(query, tokens, sendToken);
this.setState({ this.setState({

Loading…
Cancel
Save