Skip to content

Commit fc2d1dd

Browse files
ci(release): publish latest release
1 parent f3c185c commit fc2d1dd

4 files changed

Lines changed: 47 additions & 8 deletions

File tree

RELEASE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
IPFS hash of the deployment:
2-
- CIDv0: `QmWRE1gAkbA9MMVZpDdLPQyb53pFV1AbY1Uojpk9GHSmM6`
3-
- CIDv1: `bafybeidybf4xcdpahphw6yqvrjxyew5msztcexdmuasot6s3ycxvzazcqu`
2+
- CIDv0: `QmddSHFJ4MxsZxYyaGmz67cubRuhRk7fV2Upq9HWMhru3o`
3+
- CIDv1: `bafybeihdfqp6ilxsntmdrfql7zvkfeyjs3u7pe35ljr6n7clbawxosir3i`
44

55
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
66

@@ -10,5 +10,5 @@ You can also access the Uniswap Interface from an IPFS gateway.
1010
Your Uniswap settings are never remembered across different URLs.
1111

1212
IPFS gateways:
13-
- https://bafybeidybf4xcdpahphw6yqvrjxyew5msztcexdmuasot6s3ycxvzazcqu.ipfs.dweb.link/
14-
- [ipfs://QmWRE1gAkbA9MMVZpDdLPQyb53pFV1AbY1Uojpk9GHSmM6/](ipfs://QmWRE1gAkbA9MMVZpDdLPQyb53pFV1AbY1Uojpk9GHSmM6/)
13+
- https://bafybeihdfqp6ilxsntmdrfql7zvkfeyjs3u7pe35ljr6n7clbawxosir3i.ipfs.dweb.link/
14+
- [ipfs://QmddSHFJ4MxsZxYyaGmz67cubRuhRk7fV2Upq9HWMhru3o/](ipfs://QmddSHFJ4MxsZxYyaGmz67cubRuhRk7fV2Upq9HWMhru3o/)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web/5.153.2
1+
web/5.153.3

packages/uniswap/src/components/TokenSelector/lists/TokenSelectorSwapList.test.tsx

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { OnchainItemSectionName } from 'uniswap/src/components/lists/OnchainItemList/types'
88
import { useTokenSectionsForSwap } from 'uniswap/src/components/TokenSelector/lists/TokenSelectorSwapList'
99
import { TokenSelectorVariation } from 'uniswap/src/components/TokenSelector/types'
10+
import { AssetType, TradeableAsset } from 'uniswap/src/entities/assets'
1011
import { UniverseChainId } from 'uniswap/src/features/chains/types'
1112
import { renderHook } from 'uniswap/src/test/test-utils'
1213

@@ -61,11 +62,15 @@ const tokenOption = {
6162
currencyInfo: { currencyId: 'token-currency-id' },
6263
} as TokenOption
6364

64-
function renderSwapSections(variation: TokenSelectorVariation): ReturnType<typeof useTokenSectionsForSwap> {
65+
function renderSwapSections(
66+
variation: TokenSelectorVariation,
67+
options?: { chainFilter?: UniverseChainId | null; oppositeSelectedToken?: TradeableAsset },
68+
): ReturnType<typeof useTokenSectionsForSwap> {
6569
const { result } = renderHook(() =>
6670
useTokenSectionsForSwap({
6771
addresses: { evmAddress: undefined, svmAddress: undefined },
68-
chainFilter: null,
72+
chainFilter: options?.chainFilter ?? null,
73+
oppositeSelectedToken: options?.oppositeSelectedToken,
6974
variation,
7075
}),
7176
)
@@ -118,6 +123,36 @@ describe('useTokenSectionsForSwap Stocks section', () => {
118123
expect(hasStocksSection(data)).toBe(false)
119124
})
120125

126+
it('filters stocks by the input token chain when the chain filter is All Chains', () => {
127+
const inputToken: TradeableAsset = {
128+
address: '0x0000000000000000000000000000000000000001',
129+
chainId: UniverseChainId.Unichain,
130+
type: AssetType.Currency,
131+
}
132+
renderSwapSections(TokenSelectorVariation.SwapOutput, { oppositeSelectedToken: inputToken })
133+
expect(mockUseRwaTokenOptions).toHaveBeenCalledWith(
134+
expect.objectContaining({ chainFilter: UniverseChainId.Unichain }),
135+
)
136+
})
137+
138+
it('filters stocks by the selected chain even when an input token is on another chain', () => {
139+
const inputToken: TradeableAsset = {
140+
address: '0x0000000000000000000000000000000000000001',
141+
chainId: UniverseChainId.Unichain,
142+
type: AssetType.Currency,
143+
}
144+
renderSwapSections(TokenSelectorVariation.SwapOutput, {
145+
chainFilter: UniverseChainId.Base,
146+
oppositeSelectedToken: inputToken,
147+
})
148+
expect(mockUseRwaTokenOptions).toHaveBeenCalledWith(expect.objectContaining({ chainFilter: UniverseChainId.Base }))
149+
})
150+
151+
it('does not filter stocks when there is no chain filter and no input token', () => {
152+
renderSwapSections(TokenSelectorVariation.SwapOutput)
153+
expect(mockUseRwaTokenOptions).toHaveBeenCalledWith(expect.objectContaining({ chainFilter: null }))
154+
})
155+
121156
it('orders Stocks between Suggested and Bridging when both neighbors are present', () => {
122157
mockUseCommonTokensOptionsWithFallback.mockReturnValue({
123158
data: [tokenOption],

packages/uniswap/src/components/TokenSelector/lists/TokenSelectorSwapList.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ export function useTokenSectionsForSwap({
114114
const shouldShowStocks =
115115
!isRwaRegionBlocked && variation === TokenSelectorVariation.SwapOutput && !isTestnetModeEnabled
116116
// Gate the RWA query so it isn't fetched unless the Stocks section will actually render.
117-
const rwaTokenOptions = useRwaTokenOptions({ chainFilter, enabled: shouldShowStocks })
117+
// With no chain filter (All Chains), filter to the input token's chain so we never suggest impossible swaps.
118+
const rwaTokenOptions = useRwaTokenOptions({
119+
chainFilter: chainFilter ?? oppositeSelectedToken?.chainId ?? null,
120+
enabled: shouldShowStocks,
121+
})
118122
const stocksSectionOptions = useMemo(() => [rwaTokenOptions], [rwaTokenOptions])
119123
const memoizedNewTag = useMemo(() => <NewTag />, [])
120124
const stocksSection = useOnchainItemListSection({

0 commit comments

Comments
 (0)