mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
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.
This commit is contained in:
parent
b74b70df2a
commit
1ed75b45f7
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user