Skip to content

Commit

Permalink
Fix spending cap decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronfigueiredo committed Sep 10, 2024
1 parent dea62fc commit d0fdd5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 0 additions & 6 deletions test/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1077,12 +1077,6 @@ async function getEventPayloads(driver, mockedEndpoints, hasRequest = true) {
mockedRequests.push(...(await mockedEndpoint.getSeenRequests()));
}

console.log({
mockedRequests,
body: mockedRequests[0].body,
getJson: mockedRequests[0].getJson,
});

return (
await Promise.all(
mockedRequests.map(async (req) => {
Expand Down
11 changes: 10 additions & 1 deletion ui/pages/confirmations/components/confirm/title/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {
} from '../../../utils';
import { useApproveTokenSimulation } from '../info/approve/hooks/use-approve-token-simulation';
import { useIsNFT } from '../info/approve/hooks/use-is-nft';
import customSpendingCap from '../../custom-spending-cap';
import { useDecodedTransactionData } from '../info/hooks/useDecodedTransactionData';
import BigNumber from 'bignumber.js';

function ConfirmBannerAlert({ ownerId }: { ownerId: string }) {
const t = useI18nContext();
Expand Down Expand Up @@ -144,7 +147,13 @@ const ConfirmTitle: React.FC = memo(() => {
const { isNFT } = useIsNFT(currentConfirmation as TransactionMeta);

let customSpendingCap = '';
if (isTransactionMeta(currentConfirmation)) {
if (
isTransactionMeta(currentConfirmation) &&
[
TransactionType.tokenMethodApprove,
TransactionType.tokenMethodIncreaseAllowance,
].includes(currentConfirmation.type as TransactionType)
) {
const { decimals } = useAssetDetails(
currentConfirmation.txParams.to,
currentConfirmation.txParams.from,
Expand Down

0 comments on commit d0fdd5f

Please sign in to comment.