Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pnarayanaswamy committed Feb 4, 2025
1 parent 95ca259 commit 79a2a4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const SEAPORT_DATA = `{"types":{"OrderComponents":[{"name":"offerer","type":"add

const TRADE_ORDER_DATA = `{"types":{"ERC721Order":[{"type":"uint8","name":"direction"},{"type":"address","name":"maker"},{"type":"address","name":"taker"},{"type":"uint256","name":"expiry"},{"type":"uint256","name":"nonce"},{"type":"address","name":"erc20Token"},{"type":"uint256","name":"erc20TokenAmount"},{"type":"Fee[]","name":"fees"},{"type":"address","name":"erc721Token"},{"type":"uint256","name":"erc721TokenId"},{"type":"Property[]","name":"erc721TokenProperties"}],"Fee":[{"type":"address","name":"recipient"},{"type":"uint256","name":"amount"},{"type":"bytes","name":"feeData"}],"Property":[{"type":"address","name":"propertyValidator"},{"type":"bytes","name":"propertyData"}],"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}]},"domain":{"name":"ZeroEx","version":"1.0.0","chainId":"0x1","verifyingContract":"0xdef1c0ded9bec7f1a1670819833240f027b25eff"},"primaryType":"ERC721Order","message":{"direction":"0","maker":"0x8eeee1781fd885ff5ddef7789486676961873d12","taker":"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826","expiry":"2524604400","nonce":"100131415900000000000000000000000000000083840314483690155566137712510085002484","erc20Token":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","erc20TokenAmount":"42000000000000","fees":[],"erc721Token":"0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e","erc721TokenId":"2516","erc721TokenProperties":[]}}`;

const pendingPermitId = '48a75190-45ca-11ef-9001-f3886ec2397c';

const getPermitData = (permitType: string, accountAddress: string) => {
switch (permitType) {
case 'Permit':
Expand Down Expand Up @@ -48,7 +50,6 @@ export const getMetaMaskStateWithUnapprovedPermitSign = (
| 'TradeOrder',
) => {
const data = getPermitData(permitType, accountAddress);
const pendingPermitId = '48a75190-45ca-11ef-9001-f3886ec2397c';
const pendingPermitTime = new Date().getTime();
const messageParams = getMessageParams(accountAddress, data);

Expand Down Expand Up @@ -92,8 +93,6 @@ export const getMetaMaskStateWithUnapprovedPermitSign = (
};

export const getMetamaskStateWithMaliciousPermit = (accountAddress: string) => {
const pendingPermitId = '48a75190-45ca-11ef-9001-f3886ec2397c';

const state = getMetaMaskStateWithUnapprovedPermitSign(
accountAddress,
'Permit',
Expand Down
20 changes: 10 additions & 10 deletions ui/pages/confirmations/components/confirm/title/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
TransactionMeta,
TransactionType,
} from '@metamask/transaction-controller';
import React, { memo, useMemo } from 'react';
import React, { memo, useCallback, useMemo } from 'react';

Check failure on line 5 in ui/pages/confirmations/components/confirm/title/title.tsx

View workflow job for this annotation

GitHub Actions / Test lint / Test lint

'useCallback' is defined but never used

import { TokenStandard } from '../../../../../../shared/constants/transaction';
import GeneralAlert from '../../../../../components/app/alert-system/general-alert/general-alert';
Expand Down Expand Up @@ -36,15 +36,15 @@ function ConfirmBannerAlert({ ownerId }: { ownerId: string }) {
return null;
}

const onClickSupportLink = useCallback(() => {
const properties = {
properties: {
external_link_clicked: 'security_alert_support_link',
},
};
updateSignatureEventFragment(properties);
updateTransactionEventFragment(properties, ownerId);
}, [ownerId]);
const onClickSupportLink = () => {
const properties = {
properties: {
external_link_clicked: 'security_alert_support_link',
},
};
updateSignatureEventFragment(properties);
updateTransactionEventFragment(properties, ownerId);
};
return (
<Box marginTop={3}>
{generalAlerts.map((alert) => (
Expand Down

0 comments on commit 79a2a4f

Please sign in to comment.