Skip to content

Commit dd1b5ef

Browse files
ci(release): publish latest release
1 parent cd6e81b commit dd1b5ef

File tree

9 files changed

+195
-17
lines changed

9 files changed

+195
-17
lines changed

RELEASE

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
IPFS hash of the deployment:
2-
- CIDv0: `QmNseCQM3gjdY5cnH16fzEDwnaik9pnuLDaAXAWbET2gef`
3-
- CIDv1: `bafybeiah6bwq7dezzdlgk22o5nbiel2t73ev5tpo75mqebz5f4p5dw5v5q`
2+
- CIDv0: `QmTHCMo5RJfwvTbGVNppipkh5CmXYx9SPkyJM7qzyP4uLM`
3+
- CIDv1: `bafybeicjm7s57co32yesjceb5zxpmrmzex4qqxt5ynyw57nov7xo46kwzi`
44

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

@@ -10,15 +10,10 @@ 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://bafybeiah6bwq7dezzdlgk22o5nbiel2t73ev5tpo75mqebz5f4p5dw5v5q.ipfs.dweb.link/
14-
- https://bafybeiah6bwq7dezzdlgk22o5nbiel2t73ev5tpo75mqebz5f4p5dw5v5q.ipfs.cf-ipfs.com/
15-
- [ipfs://QmNseCQM3gjdY5cnH16fzEDwnaik9pnuLDaAXAWbET2gef/](ipfs://QmNseCQM3gjdY5cnH16fzEDwnaik9pnuLDaAXAWbET2gef/)
13+
- https://bafybeicjm7s57co32yesjceb5zxpmrmzex4qqxt5ynyw57nov7xo46kwzi.ipfs.dweb.link/
14+
- https://bafybeicjm7s57co32yesjceb5zxpmrmzex4qqxt5ynyw57nov7xo46kwzi.ipfs.cf-ipfs.com/
15+
- [ipfs://QmTHCMo5RJfwvTbGVNppipkh5CmXYx9SPkyJM7qzyP4uLM/](ipfs://QmTHCMo5RJfwvTbGVNppipkh5CmXYx9SPkyJM7qzyP4uLM/)
1616

17-
### 5.45.3 (2024-09-05)
18-
19-
20-
### Bug Fixes
21-
22-
* **web:** filter sugessstions if chain is undefined (#11572) f71048d
17+
### 5.45.4 (2024-09-09)
2318

2419

VERSION

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

apps/web/src/state/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { isDevEnv, isTestEnv } from 'utilities/src/environment'
1313

1414
const persistConfig: PersistConfig<InterfaceState> = {
1515
key: 'interface',
16-
version: 16, // see migrations.ts for more details about this version
16+
version: 17, // see migrations.ts for more details about this version
1717
storage: localForage.createInstance({
1818
name: INDEXED_DB_REDUX_TABLE_NAME,
1919
driver: localForage.LOCALSTORAGE,

apps/web/src/state/migrations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const defaultState = {
1313
user: {},
1414
_persist: {
1515
rehydrated: true,
16-
version: 16,
16+
version: 17,
1717
},
1818
application: {
1919
chainId: null,

apps/web/src/state/migrations.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { migration13 } from 'state/migrations/13'
1010
import { migration14 } from 'state/migrations/14'
1111
import { migration15 } from 'state/migrations/15'
1212
import { migration16 } from 'state/migrations/16'
13+
import { migration17 } from 'state/migrations/17'
1314
import { migration2 } from 'state/migrations/2'
1415
import { migration3 } from 'state/migrations/3'
1516
import { migration4 } from 'state/migrations/4'
@@ -47,6 +48,7 @@ export const migrations: MigrationManifest = {
4748
14: migration14,
4849
15: migration15,
4950
16: migration16,
51+
17: migration17,
5052
} as const
5153

5254
export const INDEXED_DB_REDUX_TABLE_NAME = 'redux'

apps/web/src/state/migrations/16.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const migrator = createMigrate(
5858
{ debug: false },
5959
)
6060

61-
describe('migration to v15', () => {
61+
describe('migration to v16', () => {
6262
it('migrates from user.tokens to shared tokens slice', async () => {
6363
const result: any = await migrator(previousState, 16)
6464
expect(result.user.tokens).toBe(undefined)
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
import { createMigrate } from 'redux-persist'
2+
import { migration1 } from 'state/migrations/1'
3+
import { migration10 } from 'state/migrations/10'
4+
import { migration11 } from 'state/migrations/11'
5+
import { migration12 } from 'state/migrations/12'
6+
import { migration13 } from 'state/migrations/13'
7+
import { migration14 } from 'state/migrations/14'
8+
import { migration15 } from 'state/migrations/15'
9+
import { migration16 } from 'state/migrations/16'
10+
import { PersistAppStateV17, migration17 } from 'state/migrations/17'
11+
import { migration2 } from 'state/migrations/2'
12+
import { migration3 } from 'state/migrations/3'
13+
import { migration4 } from 'state/migrations/4'
14+
import { migration5 } from 'state/migrations/5'
15+
import { migration6 } from 'state/migrations/6'
16+
import { migration7 } from 'state/migrations/7'
17+
import { migration8 } from 'state/migrations/8'
18+
import { migration9 } from 'state/migrations/9'
19+
import { SafetyLevel } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
20+
import { SearchResultType } from 'uniswap/src/features/search/SearchResult'
21+
22+
const previousState: PersistAppStateV17 = {
23+
_persist: {
24+
version: 16,
25+
rehydrated: true,
26+
},
27+
searchHistory: {
28+
results: [
29+
// token selector saved native asset
30+
{
31+
type: SearchResultType.Token,
32+
chainId: 1,
33+
address: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
34+
name: 'Ethereum',
35+
symbol: 'ETH',
36+
logoUrl: 'https://token-icons.s3.amazonaws.com/eth.png',
37+
safetyLevel: SafetyLevel.Verified,
38+
searchId: 'token-1-0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
39+
},
40+
// navbar saved native asset
41+
{
42+
type: SearchResultType.Token,
43+
chainId: 1,
44+
symbol: 'ETH',
45+
address: null,
46+
name: 'Ethereum',
47+
logoUrl: 'https://token-icons.s3.amazonaws.com/eth.png',
48+
safetyLevel: SafetyLevel.Verified,
49+
searchId: 'token-1-null',
50+
},
51+
// token selector saved token
52+
{
53+
type: SearchResultType.Token,
54+
chainId: 42161,
55+
symbol: 'USDC',
56+
address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831',
57+
name: 'USD Coin',
58+
logoUrl: 'https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694',
59+
safetyLevel: SafetyLevel.Verified,
60+
searchId: 'token-42161-0xaf88d065e77c8cc2239327c5edb3a432268e5831',
61+
},
62+
// navbar saved nft collection
63+
{
64+
type: SearchResultType.NFTCollection,
65+
chainId: 1,
66+
address: '0xbd3531da5cf5857e7cfaa92426877b022e612cf8',
67+
name: 'Pudgy Penguins',
68+
imageUrl:
69+
'https://i.seadn.io/gae/yNi-XdGxsgQCPpqSio4o31ygAV6wURdIdInWRcFIl46UjUQ1eV7BEndGe8L661OoG-clRi7EgInLX4LPu9Jfw4fq0bnVYHqg7RFi?w=500&auto=format',
70+
isVerified: true,
71+
searchId: 'nftCollection-1-0xbd3531da5cf5857e7cfaa92426877b022e612cf8',
72+
},
73+
],
74+
},
75+
}
76+
77+
const migrator = createMigrate(
78+
{
79+
1: migration1,
80+
2: migration2,
81+
3: migration3,
82+
4: migration4,
83+
5: migration5,
84+
6: migration6,
85+
7: migration7,
86+
8: migration8,
87+
9: migration9,
88+
10: migration10,
89+
11: migration11,
90+
12: migration12,
91+
13: migration13,
92+
14: migration14,
93+
15: migration15,
94+
16: migration16,
95+
17: migration17,
96+
},
97+
{ debug: false },
98+
)
99+
100+
describe('migration to v17', () => {
101+
it('migrates potentially invalid searchHistory', async () => {
102+
const result: any = await migrator(previousState, 17)
103+
expect(result.searchHistory.results).toEqual([
104+
{
105+
type: SearchResultType.Token,
106+
chainId: 1,
107+
symbol: 'ETH',
108+
address: null,
109+
name: 'Ethereum',
110+
logoUrl: 'https://token-icons.s3.amazonaws.com/eth.png',
111+
safetyLevel: SafetyLevel.Verified,
112+
searchId: 'token-1-null',
113+
},
114+
{
115+
type: SearchResultType.Token,
116+
chainId: 42161,
117+
symbol: 'USDC',
118+
address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831',
119+
name: 'USD Coin',
120+
logoUrl: 'https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694',
121+
safetyLevel: SafetyLevel.Verified,
122+
searchId: 'token-42161-0xaf88d065e77c8cc2239327c5edb3a432268e5831',
123+
},
124+
{
125+
type: SearchResultType.NFTCollection,
126+
chainId: 1,
127+
address: '0xbd3531da5cf5857e7cfaa92426877b022e612cf8',
128+
name: 'Pudgy Penguins',
129+
imageUrl:
130+
'https://i.seadn.io/gae/yNi-XdGxsgQCPpqSio4o31ygAV6wURdIdInWRcFIl46UjUQ1eV7BEndGe8L661OoG-clRi7EgInLX4LPu9Jfw4fq0bnVYHqg7RFi?w=500&auto=format',
131+
isVerified: true,
132+
searchId: 'nftCollection-1-0xbd3531da5cf5857e7cfaa92426877b022e612cf8',
133+
},
134+
])
135+
})
136+
})

apps/web/src/state/migrations/17.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { PersistState } from 'redux-persist'
2+
import { SearchResult, SearchResultType } from 'uniswap/src/features/search/SearchResult'
3+
import { searchResultId } from 'uniswap/src/features/search/searchHistorySlice'
4+
import { tokenAddressOrNativeAddress } from 'uniswap/src/features/search/utils'
5+
6+
export type PersistAppStateV17 = {
7+
_persist: PersistState
8+
searchHistory?: {
9+
results: SearchResult[]
10+
}
11+
}
12+
13+
/**
14+
* Move potentially invalid native asset search history items to valid format
15+
*/
16+
export const migration17 = (state: PersistAppStateV17 | undefined) => {
17+
if (!state) {
18+
return
19+
}
20+
21+
const newState: any = { ...state }
22+
23+
// amend existing recently searched native assets that were saved with
24+
// an address when they should not have been
25+
newState.searchHistory.results.forEach((result: SearchResult) => {
26+
if (result.type === SearchResultType.Token && result.address) {
27+
const nativeAddress = tokenAddressOrNativeAddress(result.address, result.chainId)
28+
if (result.address !== nativeAddress) {
29+
result.address = nativeAddress
30+
result.searchId = searchResultId(result)
31+
}
32+
}
33+
})
34+
35+
// dedupe search history
36+
const dedupedSearchHistory = newState.searchHistory.results.filter(
37+
(result: SearchResult, index: number, self: SearchResult[]) =>
38+
self.findIndex((t) => t.searchId === result.searchId) === index,
39+
)
40+
41+
newState.searchHistory.results = dedupedSearchHistory
42+
43+
return { ...newState, _persist: { ...state._persist, version: 17 } }
44+
}

packages/uniswap/src/features/search/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { buildCurrencyId, currencyIdToGraphQLAddress } from 'uniswap/src/utils/c
55
export const BACKEND_NATIVE_CHAIN_ADDRESS_STRING = 'NATIVE'
66

77
export function tokenAddressOrNativeAddress(address: string, chainId: UniverseChainId): string | null {
8-
if (address !== BACKEND_NATIVE_CHAIN_ADDRESS_STRING) {
8+
const nativeAddress = getNativeAddress(chainId)
9+
10+
if (address !== BACKEND_NATIVE_CHAIN_ADDRESS_STRING && address !== nativeAddress) {
911
return address
1012
}
1113

12-
const nativeAddress = getNativeAddress(chainId)
1314
return currencyIdToGraphQLAddress(buildCurrencyId(chainId, nativeAddress))
1415
}

0 commit comments

Comments
 (0)