Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing tests #878

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions earn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@tanstack/query-sync-storage-persister": "^5.37.1",
"@tanstack/react-query": "5.35.1",
"@tanstack/react-query-persist-client": "^5.37.1",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/big.js": "^6.1.2",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.22",
Expand Down
8 changes: 4 additions & 4 deletions earn/src/components/advanced/BorrowGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { LABEL_TEXT_COLOR } from 'shared/lib/components/common/Modal';
import { Text } from 'shared/lib/components/common/Typography';
import useMediaQuery from 'shared/lib/hooks/UseMediaQuery';
import styled from 'styled-components';

import BorrowGraphTooltip from './BorrowGraphTooltip';
import {
RESPONSIVE_BREAKPOINT_MD,
RESPONSIVE_BREAKPOINT_SM,
RESPONSIVE_BREAKPOINTS,
} from 'shared/lib/data/constants/Breakpoints';
import useMediaQuery from 'shared/lib/hooks/UseMediaQuery';
import styled from 'styled-components';

import BorrowGraphTooltip from './BorrowGraphTooltip';
import Graph from '../graph/Graph';

const TEXT_COLOR = '#82a0b6';
Expand Down
9 changes: 2 additions & 7 deletions earn/src/hooks/UseRedeem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { lenderLensAbi } from 'shared/lib/abis/LenderLens';
import { ALOE_II_LENDER_LENS_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { GN } from 'shared/lib/data/GoodNumber';
import { Address, erc4626Abi, maxUint256, zeroAddress } from 'viem';
import {
useReadContract,
useReadContracts,
useSimulateContract,
useWriteContract,
} from 'wagmi';
import { useReadContract, useReadContracts, useSimulateContract, useWriteContract } from 'wagmi';

export enum RedeemState {
WAITING_FOR_INPUT,
Expand Down Expand Up @@ -65,7 +60,7 @@ export function useRedeem(
});
const shares = sharesData ?? 0n;

const threshold = maxShares * 999n / 1000n;
const threshold = (maxShares * 999n) / 1000n;
const shouldRedeemMax = shares >= threshold && maxSharesIsChanging;

/*//////////////////////////////////////////////////////////////
Expand Down
6 changes: 1 addition & 5 deletions earn/src/pages/AdvancedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,7 @@ export default function AdvancedPage() {
/>
</GridAreaForNFTList>
<GridAreaForData>
<BorrowMetrics
market={market}
borrowerNft={selection}
userHasNoMarginAccounts={!userHasBorrowers}
/>
<BorrowMetrics market={market} borrowerNft={selection} userHasNoMarginAccounts={!userHasBorrowers} />
<UniswapPositionList
borrower={selection}
importableUniswapNFTPositions={filteredNonZeroUniswapNFTPositions}
Expand Down
11 changes: 6 additions & 5 deletions earn/src/pages/MarketsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ export default function MarketsPage() {
}),
[activeChain.id]
);
const {
borrowerNfts,
refetchBorrowerNftRefs,
refetchBorrowers,
} = useBorrowerNfts(uniswapPools, userAddress, activeChain.id, borrowerNftFilterParams);
const { borrowerNfts, refetchBorrowerNftRefs, refetchBorrowers } = useBorrowerNfts(
uniswapPools,
userAddress,
activeChain.id,
borrowerNftFilterParams
);
const borrowers = useDeprecatedMarginAccountShim(lendingPairs, borrowerNfts);

// Poll for `blockNumber` when app is in the foreground. Not much different than a `useInterval` that stops
Expand Down
7 changes: 1 addition & 6 deletions earn/src/pages/PortfolioPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,7 @@ export default function PortfolioPage() {
if (isConnected) setIsWithdrawModalOpen(true);
}}
/>
<PortfolioActionButton
label={'Bridge'}
disabled={true}
Icon={<TruckIcon />}
onClick={() => {}}
/>
<PortfolioActionButton label={'Bridge'} disabled={true} Icon={<TruckIcon />} onClick={() => {}} />
</PortfolioActionButtonsContainer>
<div className='mt-10'>
<PortfolioPageWidgetWrapper tooltip={PORTFOLIO_GRID_TOOLTIP_TEXT} tooltipId='portfolioGrid'>
Expand Down
6 changes: 3 additions & 3 deletions prime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@tanstack/query-sync-storage-persister": "^5.37.1",
"@tanstack/react-query": "5.35.1",
"@tanstack/react-query-persist-client": "^5.37.1",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/big.js": "^6.1.2",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.22",
Expand Down
11 changes: 7 additions & 4 deletions shared/src/hooks/UseBorrowerNft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ export function useBorrowerNfts(
const { borrowers, refetchBorrowers } = useBorrowers(uniswapPools, borrowerNftRefs, chainId, staleTime);

const borrowerNfts = useMemo(() => {
return borrowerNftRefs.map((borrowerNftRef, i) => ({
...borrowerNftRef,
borrower: borrowers.at(i),
} as BorrowerNft));
return borrowerNftRefs.map(
(borrowerNftRef, i) =>
({
...borrowerNftRef,
borrower: borrowers.at(i),
} as BorrowerNft)
);
}, [borrowerNftRefs, borrowers]);

return { borrowerNfts, refetchBorrowerNftRefs, refetchBorrowers };
Expand Down
84 changes: 40 additions & 44 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.3.tgz#90749bde8b89cd41764224f5aac29cd4138f75ff"
integrity sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==

"@adobe/css-tools@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.0.tgz#728c484f4e10df03d5a3acd0d8adcbbebff8ad63"
integrity sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==

"@adraffy/[email protected]":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7"
Expand Down Expand Up @@ -1205,7 +1210,7 @@
preact "^10.16.0"
sha.js "^2.4.11"

"@coinbase/wallet-sdk@^3.5.3":
"@coinbase/wallet-sdk@^3.5.3", "cbw-sdk@npm:@coinbase/[email protected]":
version "3.9.3"
resolved "https://registry.yarnpkg.com/@coinbase/wallet-sdk/-/wallet-sdk-3.9.3.tgz#daf10cb0c85d0363315b7270cb3f02bedc408aab"
integrity sha512-N/A2DRIf0Y3PHc1XAMvbBUu4zisna6qAdqABMZwBMNEfWrXpAwx16pZGkYCLGE+Rvv1edbcB2LYDRnACNcmCiw==
Expand Down Expand Up @@ -3613,6 +3618,20 @@
lodash "^4.17.15"
redent "^3.0.0"

"@testing-library/jest-dom@^6.4.6":
version "6.4.6"
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.6.tgz#ec1df8108651bed5475534955565bed88c6732ce"
integrity sha512-8qpnGVincVDLEcQXWaHOf6zmlbwTKc6Us6PPu4CRnPXCzo2OGBS5cwgMMOWdxDpEz1mkbvXHpEy99M5Yvt682w==
dependencies:
"@adobe/css-tools" "^4.4.0"
"@babel/runtime" "^7.9.2"
aria-query "^5.0.0"
chalk "^3.0.0"
css.escape "^1.5.1"
dom-accessibility-api "^0.6.3"
lodash "^4.17.21"
redent "^3.0.0"

"@testing-library/react@^12.1.2":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-12.1.5.tgz#bb248f72f02a5ac9d949dea07279095fa577963b"
Expand All @@ -3622,13 +3641,25 @@
"@testing-library/dom" "^8.0.0"
"@types/react-dom" "<18.0.0"

"@testing-library/react@^16.0.0":
version "16.0.0"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.0.0.tgz#0a1e0c7a3de25841c3591b8cb7fb0cf0c0a27321"
integrity sha512-guuxUKRWQ+FgNX0h0NS0FIq3Q3uLtWVpBzcLOggmfMoUpgBnzBzvLLd4fbm6yS8ydJd94cIfY4yP9qUQjM2KwQ==
dependencies:
"@babel/runtime" "^7.12.5"

"@testing-library/user-event@^13.5.0":
version "13.5.0"
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-13.5.0.tgz#69d77007f1e124d55314a2b73fd204b333b13295"
integrity sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg==
dependencies:
"@babel/runtime" "^7.12.5"

"@testing-library/user-event@^14.5.2":
version "14.5.2"
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.5.2.tgz#db7257d727c891905947bd1c1a99da20e03c2ebd"
integrity sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==

"@tootallnate/once@1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
Expand Down Expand Up @@ -6154,21 +6185,6 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==

"cbw-sdk@npm:@coinbase/[email protected]":
version "3.9.3"
resolved "https://registry.yarnpkg.com/@coinbase/wallet-sdk/-/wallet-sdk-3.9.3.tgz#daf10cb0c85d0363315b7270cb3f02bedc408aab"
integrity sha512-N/A2DRIf0Y3PHc1XAMvbBUu4zisna6qAdqABMZwBMNEfWrXpAwx16pZGkYCLGE+Rvv1edbcB2LYDRnACNcmCiw==
dependencies:
bn.js "^5.2.1"
buffer "^6.0.3"
clsx "^1.2.1"
eth-block-tracker "^7.1.0"
eth-json-rpc-filters "^6.0.0"
eventemitter3 "^5.0.1"
keccak "^3.0.3"
preact "^10.16.0"
sha.js "^2.4.11"

[email protected]:
version "5.3.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385"
Expand Down Expand Up @@ -7447,6 +7463,11 @@ dom-accessibility-api@^0.5.6, dom-accessibility-api@^0.5.9:
resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453"
integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==

dom-accessibility-api@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8"
integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==

dom-converter@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768"
Expand Down Expand Up @@ -14873,7 +14894,7 @@ string-similarity@^4.0.3:
resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b"
integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==

"string-width-cjs@npm:string-width@^4.2.0":
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -14891,15 +14912,6 @@ string-width@^3.0.0, string-width@^3.1.0:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
Expand Down Expand Up @@ -14983,7 +14995,7 @@ stringify-object@^3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -14997,13 +15009,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -16610,7 +16615,7 @@ [email protected]:
"@types/trusted-types" "^2.0.2"
workbox-core "6.6.1"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -16637,15 +16642,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.0.1, wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down