Skip to content

Commit 8463bf4

Browse files
ci(release): publish latest release
1 parent 5eff736 commit 8463bf4

File tree

784 files changed

+18561
-11972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

784 files changed

+18561
-11972
lines changed

RELEASE

+47-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
IPFS hash of the deployment:
2-
- CIDv0: `QmTyp6ePbkJCs819zgUB4Pye4E2cTudcy4SZd5MJkk89Pb`
3-
- CIDv1: `bafybeictz6ffben6zjcs6sk752jegq56ceo7m5nciosofntokzsthxrzey`
2+
- CIDv0: `QmWe2TF9c45GQYs4stbUXrYQvX34xQaaNTdU3T24DiRwLe`
3+
- CIDv1: `bafybeid3kd2hknxwdz7hcsqrebostgihtwucjlonlzw6oaaxjlsbgmcqdm`
44

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

@@ -10,15 +10,55 @@ 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://bafybeictz6ffben6zjcs6sk752jegq56ceo7m5nciosofntokzsthxrzey.ipfs.dweb.link/
14-
- https://bafybeictz6ffben6zjcs6sk752jegq56ceo7m5nciosofntokzsthxrzey.ipfs.cf-ipfs.com/
15-
- [ipfs://QmTyp6ePbkJCs819zgUB4Pye4E2cTudcy4SZd5MJkk89Pb/](ipfs://QmTyp6ePbkJCs819zgUB4Pye4E2cTudcy4SZd5MJkk89Pb/)
13+
- https://bafybeid3kd2hknxwdz7hcsqrebostgihtwucjlonlzw6oaaxjlsbgmcqdm.ipfs.dweb.link/
14+
- https://bafybeid3kd2hknxwdz7hcsqrebostgihtwucjlonlzw6oaaxjlsbgmcqdm.ipfs.cf-ipfs.com/
15+
- [ipfs://QmWe2TF9c45GQYs4stbUXrYQvX34xQaaNTdU3T24DiRwLe/](ipfs://QmWe2TF9c45GQYs4stbUXrYQvX34xQaaNTdU3T24DiRwLe/)
1616

17-
### 5.29.1 (2024-05-24)
17+
## 5.30.0 (2024-05-30)
18+
19+
20+
### Features
21+
22+
* **web:** [multichain] handle default input token logic (#8209) 3eed0e3
23+
* **web:** 4131 default to token project name instead of token name (#8325) 1debde2
24+
* **web:** 4171 fix duplicate keys in currency search, show balance (#8320) 4c81e41
25+
* **web:** add Mobile App Promo Banner component (#8257) c03744d
26+
* **web:** Add Multichain Explore Feature Flag and Dropdown option (#8314) 27683d8
27+
* **web:** converge to single analytics implementation (#8161) 30558ba
28+
* **web:** convert all Trace elements to shared API (#8159) b340e9b
29+
* **web:** convert all TraceEvent usage to shared trace (#8053) 3631853
30+
* **web:** disable Liquidity Charts on V2 PDP (#8468) 66aad34
31+
* **web:** migrates to using shared analytics send + typing relevant events (#8051) 11c6325
32+
* **web:** Sitemap generation round 3?? (#8323) b6e42b6
33+
* **web:** unicon v2 education label (#8339) f92cd5e
34+
* **web:** use app-specific download links for competitor wallets (#8258) 399844e
35+
* **web:** use new chains with wagmi (#8083) dc14772
36+
* **web:** use new error dialog design (#6974) ae3628c
37+
* **web:** use Xv2 arbitrum experiment parameters for quote (#8251) 08ab621
1838

1939

2040
### Bug Fixes
2141

22-
* **web:** Check if WC getNamespaceChainsIds is empty rather than unde… (#8455) 40a9355
42+
* **web:** add liquidity title fix (#8298) b587de4
43+
* **web:** Check if WC getNamespaceChainsIds is empty rather than undefined (#8422) 2c76bff
44+
* **web:** dont fetch portfolio balances if multichain ux is not enabled (#8478) 35debe1
45+
* **web:** e2e test amplitude checks (#8391) ef3a9e5
46+
* **web:** enable base eth and usdc for moonpay (#8330) ac0ba90
47+
* **web:** failing e2e tests and wrong ethereum name (#8373) 1cd24a6
48+
* **web:** filtering out spam on send (#8386) 322551b
49+
* **web:** Fix blocking Testlio bugs - staging (#8592) 55a9345
50+
* **web:** fix broken translations (#8580) df6f23d
51+
* **web:** fix failing e2e tests (#8480) 1535f19
52+
* **web:** handle chainName passed as the tab param (#8317) 4555cfd
53+
* **web:** lowercase unicon flag (#8380) dbfe14a
54+
* **web:** mouseover position bug (#8384) 2d8cd91
55+
* **web:** prevent 1H time period on PDP price chart (#8315) ddc10ca
56+
* **web:** prevent connection from hanging when iframed (#8379) 2feccc4
57+
* **web:** Unicon loading state (#8415) 76f29f5
58+
59+
60+
### Continuous Integration
61+
62+
* **web:** update sitemaps b837434
2363

2464

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web/5.29.1
1+
web/5.30.0

apps/mobile/.depcheckrc

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ignores: [
1515
"@react-native-masked-view/masked-view",
1616
"@react-native-firebase/app-check",
1717
"react-native-image-colors",
18+
"react-native-restart",
1819
# Dependencies that depcheck thinks are missing but are actually present or never used
1920
## Internal packages / workspaces
2021
"e2e",

apps/mobile/README.md

+4-12
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,7 @@ These are some tools you might want to familiarize yourself with to understand t
176176

177177
## Migrations
178178

179-
We use `redux-persist` to persist Redux state between user sessions. When the Redux state schema is altered, a migration may be needed to transfer the existing persisted state to the new Redux schema. Failing to define a migration results in the app defaulting to the persisted schema, which will very likely cause `undefined` errors because the code has references to Redux state properties that were dropped in favor the persisted schema.
180-
181-
### When to define a migration
182-
183-
Anytime a required property is added or any property is renamed or deleted to/from Redux state. Migrations are not necessary when optional properties are added to an existing slice. Make sure to always add new required properties to the `schema.ts` file as well.
184-
185-
### How to migrate
186-
187-
1. Increment the `version` of `persistConfig` defined within `store.ts`
188-
2. Create a migration function within `migrations.ts`. The migration key should be the same as the `version` defined in the previous step
189-
3. Write a test for your migration within `migrations.test.ts`
190-
4. Create a new schema within `schema.ts` and ensure it is being exported by the `getSchema` function at the bottom of the file
179+
We use `redux-persist` to persist the Redux state between user sessions. Most of this state is shared between the mobile app and the extension. Please review the [Wallet Migrations README](../../packages/wallet/src/state//README.md) for details on how to write migrations when you add or remove anything from the Redux state structure.
191180

192181
## Troubleshooting
193182

@@ -199,6 +188,9 @@ This means whichever package you're trying to run (`[package name]`) wasn’t co
199188
- `unable to open file (in target "OneSignalNotificationServiceExtension" in project "Uniswap")`.
200189
Resolve this issue by navigating to the `ios/` directory and running `pod update`.
201190

191+
- `Build target hermes-engine: Command PhaseScriptExecution failed with a nonzero exit code`
192+
Node isn't being located correctly during the build phase. Run `which node` and copy the resulting path into `.xcode.env.local`. More context [here](https://github.com/facebook/react-native/issues/42221).
193+
202194
### Common fixes
203195

204196
If something isn’t working the way it should or you’re getting a weird error when trying to run the app, try the following:

apps/mobile/android/app/src/main/java/com/uniswap/RnEthersRs.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ class RnEthersRs(applicationContext: Context) {
2929
}
3030

3131
val mnemonicIds: List<String>
32-
get() = keychain.all.keys.map {
33-
key -> key.replace(ENTIRE_MNEMONIC_PREFIX, "")
34-
}
32+
get() = keychain.all.keys.filter {
33+
// MOB-3453 this will need to be updated after fixing prefixes
34+
it.startsWith(MNEMONIC_PREFIX)
35+
}.map {
36+
key -> key.replace(MNEMONIC_PREFIX, "")
37+
}
3538

3639
/**
3740
* Imports a mnemonic and returns the associated address.
@@ -187,6 +190,7 @@ class RnEthersRs(applicationContext: Context) {
187190
private const val PREFIX = "com.uniswap"
188191
private const val MNEMONIC_PREFIX = ".mnemonic."
189192
private const val PRIVATE_KEY_PREFIX = ".privateKey."
193+
// MOB-3453 Android is currently not storing keys with PREFIX
190194
private const val ENTIRE_MNEMONIC_PREFIX = PREFIX + MNEMONIC_PREFIX
191195
}
192196
}

apps/mobile/android/app/src/main/java/com/uniswap/onboarding/import/SeedPhraseInputViewModel.kt

+4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ class SeedPhraseInputViewModel(
109109
// TODO gary add production logging and update rust code to convert to Java exceptions
110110
Log.d("SeedPhraseInputViewModel", "Storing mnemonic caused error ${e.message}")
111111
}
112+
113+
if (status is Status.Error) {
114+
onInputValidated(false)
115+
}
112116
}
113117

114118
private fun submitMnemonic(mnemonic: String) {

apps/mobile/ios/Uniswap.xcodeproj/project.pbxproj

+12-6
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@
139139
2F50877AC4F0BB2556A74B60 /* libPods-Uniswap-UniswapTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A1B8962666C68EE8B75C18 /* libPods-Uniswap-UniswapTests.a */; };
140140
5EFB78362B1E585000E77EAC /* ConvertQuery.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EFB78352B1E585000E77EAC /* ConvertQuery.graphql.swift */; };
141141
5FF6D300AEE2EB390A272D0E /* libPods-WidgetIntentExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 71A42CE7FF1299C666E6FC79 /* libPods-WidgetIntentExtension.a */; };
142-
681301B12A3726EE00A5BF43 /* onboarding_dark.riv in Resources */ = {isa = PBXBuildFile; fileRef = 681301AD2A3726EE00A5BF43 /* onboarding_dark.riv */; };
143142
681301B22A3726EE00A5BF43 /* pending_send.riv in Resources */ = {isa = PBXBuildFile; fileRef = 681301AE2A3726EE00A5BF43 /* pending_send.riv */; };
144143
681301B42A3726EE00A5BF43 /* pending_swap.riv in Resources */ = {isa = PBXBuildFile; fileRef = 681301B02A3726EE00A5BF43 /* pending_swap.riv */; };
145144
6BC7D07E2B5FF02400617C95 /* ScantasticEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BC7D07B2B5FF02400617C95 /* ScantasticEncryption.m */; };
@@ -187,6 +186,7 @@
187186
9FEC9B8B2A858CF1003CD019 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FEC9B8A2A858CF1003CD019 /* AppDelegate.m */; };
188187
A32F9FBD272343C9002CFCDB /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A32F9FBC272343C8002CFCDB /* GoogleService-Info.plist */; };
189188
A3F0A5B1272B1DFA00895B25 /* KeychainSwiftDistrib.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3F0A5B0272B1DFA00895B25 /* KeychainSwiftDistrib.swift */; };
189+
A7B8EFCB2BF68F0D00CA4A1C /* FeeData.graphql.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B8EFCA2BF68F0D00CA4A1C /* FeeData.graphql.swift */; };
190190
AC0EE0982BD826E700BCCF07 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = AC0EE0972BD826E700BCCF07 /* PrivacyInfo.xcprivacy */; };
191191
AEE498F72A85AD86000DDF8E /* Basel-Book.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AEE498F52A85AD86000DDF8E /* Basel-Book.ttf */; };
192192
AEE498F82A85AD86000DDF8E /* Basel-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AEE498F62A85AD86000DDF8E /* Basel-Medium.ttf */; };
@@ -442,7 +442,6 @@
442442
56FE9C9AF785221B7E3F4C04 /* Pods-Uniswap.dev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uniswap.dev.xcconfig"; path = "Target Support Files/Pods-Uniswap/Pods-Uniswap.dev.xcconfig"; sourceTree = "<group>"; };
443443
5EFB78352B1E585000E77EAC /* ConvertQuery.graphql.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConvertQuery.graphql.swift; sourceTree = "<group>"; };
444444
62CEA9F2D5176D20A6402A3E /* Pods-Uniswap.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uniswap.beta.xcconfig"; path = "Target Support Files/Pods-Uniswap/Pods-Uniswap.beta.xcconfig"; sourceTree = "<group>"; };
445-
681301AD2A3726EE00A5BF43 /* onboarding_dark.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = onboarding_dark.riv; sourceTree = "<group>"; };
446445
681301AE2A3726EE00A5BF43 /* pending_send.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = pending_send.riv; sourceTree = "<group>"; };
447446
681301B02A3726EE00A5BF43 /* pending_swap.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = pending_swap.riv; sourceTree = "<group>"; };
448447
6BC7D07B2B5FF02400617C95 /* ScantasticEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScantasticEncryption.m; sourceTree = "<group>"; };
@@ -495,6 +494,7 @@
495494
9FEC9B8A2A858CF1003CD019 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Uniswap/AppDelegate.m; sourceTree = "<group>"; };
496495
A32F9FBC272343C8002CFCDB /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
497496
A3F0A5B0272B1DFA00895B25 /* KeychainSwiftDistrib.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainSwiftDistrib.swift; sourceTree = "<group>"; };
497+
A7B8EFCA2BF68F0D00CA4A1C /* FeeData.graphql.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FeeData.graphql.swift; path = MobileSchema/Schema/Objects/FeeData.graphql.swift; sourceTree = "<group>"; };
498498
A7C9F415D0E128A43003E071 /* Pods-Uniswap.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uniswap.debug.xcconfig"; path = "Target Support Files/Pods-Uniswap/Pods-Uniswap.debug.xcconfig"; sourceTree = "<group>"; };
499499
AC0EE0972BD826E700BCCF07 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = Uniswap/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
500500
AEE498F52A85AD86000DDF8E /* Basel-Book.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Basel-Book.ttf"; path = "../src/assets/fonts/Basel-Book.ttf"; sourceTree = "<group>"; };
@@ -634,6 +634,7 @@
634634
072E23872A44D5BD006AD6C9 /* WidgetsCore */ = {
635635
isa = PBXGroup;
636636
children = (
637+
A7B8EFCA2BF68F0D00CA4A1C /* FeeData.graphql.swift */,
637638
07F0C28E2A5F3E2E00D5353E /* Env.swift */,
638639
073C67F42A5C8FBE00F6DAD8 /* MobileSchema */,
639640
072E23882A44D5BD006AD6C9 /* WidgetsCore.h */,
@@ -1840,6 +1841,7 @@
18401841
0743223B2A83E3CA00F8518D /* NftAssetsFilterInput.graphql.swift in Sources */,
18411842
0DC6ADF02B1E2C100092909C /* PortfolioValueModifier.graphql.swift in Sources */,
18421843
074322282A83E3CA00F8518D /* TokenProjectMarket.graphql.swift in Sources */,
1844+
A7B8EFCB2BF68F0D00CA4A1C /* FeeData.graphql.swift in Sources */,
18431845
0743220F2A83E3CA00F8518D /* NftApproveForAll.graphql.swift in Sources */,
18441846
0743223C2A83E3CA00F8518D /* SchemaMetadata.graphql.swift in Sources */,
18451847
074321FA2A83E3CA00F8518D /* PortfolioBalancesQuery.graphql.swift in Sources */,
@@ -2953,7 +2955,8 @@
29532955
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
29542956
OTHER_LDFLAGS = (
29552957
"$(inherited)",
2956-
" ",
2958+
"-Wl",
2959+
"-ld_classic",
29572960
);
29582961
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
29592962
SDKROOT = iphoneos;
@@ -3019,7 +3022,8 @@
30193022
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
30203023
OTHER_LDFLAGS = (
30213024
"$(inherited)",
3022-
" ",
3025+
"-Wl",
3026+
"-ld_classic",
30233027
);
30243028
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
30253029
SDKROOT = iphoneos;
@@ -3172,7 +3176,8 @@
31723176
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
31733177
OTHER_LDFLAGS = (
31743178
"$(inherited)",
3175-
" ",
3179+
"-Wl",
3180+
"-ld_classic",
31763181
);
31773182
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
31783183
SDKROOT = iphoneos;
@@ -3346,7 +3351,8 @@
33463351
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
33473352
OTHER_LDFLAGS = (
33483353
"$(inherited)",
3349-
" ",
3354+
"-Wl",
3355+
"-ld_classic",
33503356
);
33513357
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
33523358
SDKROOT = iphoneos;

apps/mobile/jest-setup.js

-11
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@ import { localizeMock as mockRNLocalize } from 'react-native-localize/mock'
99
import { AppearanceSettingType } from 'wallet/src/features/appearance/slice'
1010
import { mockLocalizationContext } from 'wallet/src/test/mocks/utils'
1111

12-
// avoids polluting console in test runs, while keeping important log levels
13-
global.console = {
14-
...console,
15-
// uncomment to ignore a specific log level
16-
log: jest.fn(),
17-
debug: jest.fn(),
18-
info: jest.fn(),
19-
// warn: jest.fn(),
20-
// error: jest.fn(),
21-
}
22-
2312
// Mock Sentry crash reporting
2413
jest.mock('@sentry/react-native', () => ({
2514
init: () => jest.fn(),

apps/mobile/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"react-native-pager-view": "6.0.1",
132132
"react-native-permissions": "3.6.0",
133133
"react-native-reanimated": "3.8.1",
134+
"react-native-restart": "0.0.27",
134135
"react-native-safe-area-context": "4.9.0",
135136
"react-native-screens": "3.30.1",
136137
"react-native-splash-screen": "3.3.0",

apps/mobile/src/app/App.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { flexStyles, useIsDarkMode } from 'ui/src'
4646
import { config } from 'uniswap/src/config'
4747
import { uniswapUrls } from 'uniswap/src/constants/urls'
4848
import { DUMMY_STATSIG_SDK_KEY } from 'uniswap/src/features/gating/constants'
49-
import { WALLET_EXPERIMENTS } from 'uniswap/src/features/gating/experiments'
49+
import { Experiments } from 'uniswap/src/features/gating/experiments'
5050
import { WALLET_FEATURE_FLAG_NAMES } from 'uniswap/src/features/gating/flags'
5151
import { loadStatsigOverrides } from 'uniswap/src/features/gating/overrides/customPersistedOverrides'
5252
import { Statsig, StatsigProvider } from 'uniswap/src/features/gating/sdk/statsig'
@@ -177,10 +177,10 @@ function SentryTags({ children }: PropsWithChildren): JSX.Element {
177177
Sentry.setTag(`featureFlag.${flagKey}`, Statsig.checkGateWithExposureLoggingDisabled(flagKey))
178178
}
179179

180-
for (const [_, experimentDef] of WALLET_EXPERIMENTS.entries()) {
180+
for (const experiment of Object.values(Experiments)) {
181181
Sentry.setTag(
182-
`experiment.${experimentDef.name}`,
183-
Statsig.getExperimentWithExposureLoggingDisabled(experimentDef.name).getGroupName()
182+
`experiment.${experiment}`,
183+
Statsig.getExperimentWithExposureLoggingDisabled(experiment).getGroupName()
184184
)
185185
}
186186
}, [])

apps/mobile/src/app/migrations.test.ts

+6-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable max-lines */
22
import { BigNumber } from 'ethers'
33
import mockdate from 'mockdate'
4-
import createMigrate from 'src/app/createMigrate'
54
import { migrations, OLD_DEMO_ACCOUNT_ADDRESS } from 'src/app/migrations'
65
import {
76
getSchema,
@@ -104,6 +103,8 @@ import {
104103
SignerMnemonicAccount,
105104
} from 'wallet/src/features/wallet/accounts/types'
106105
import { initialWalletState, SwapProtectionSetting } from 'wallet/src/features/wallet/slice'
106+
import { createMigrate } from 'wallet/src/state/createMigrate'
107+
import { getAllKeysOfNestedObject } from 'wallet/src/state/testUtils'
107108
import {
108109
fiatPurchaseTransactionInfo,
109110
signerMnemonicAccount,
@@ -124,26 +125,6 @@ const fiatOnRampTxDetailsFailed = transactionDetails({
124125
}),
125126
})
126127

127-
// helps with object assignment
128-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
129-
const getAllKeysOfNestedObject = (obj: any, prefix = ''): string[] => {
130-
const keys = Object.keys(obj)
131-
if (!keys.length && prefix !== '') {
132-
return [prefix.slice(0, -1)]
133-
}
134-
return keys.reduce<string[]>((res, el) => {
135-
if (Array.isArray(obj[el])) {
136-
return [...res]
137-
}
138-
139-
if (typeof obj[el] === 'object' && obj[el] !== null) {
140-
return [...res, ...getAllKeysOfNestedObject(obj[el], prefix + el + '.')]
141-
}
142-
143-
return [...res, prefix + el]
144-
}, [])
145-
}
146-
147128
describe('Redux state migrations', () => {
148129
it('is able to perform all migrations starting from the initial schema', async () => {
149130
const initialSchemaStub = {
@@ -204,6 +185,10 @@ describe('Redux state migrations', () => {
204185
},
205186
}
206187

188+
if (!migratedSchema) {
189+
throw new Error('Migrated schema is undefined')
190+
}
191+
207192
const migratedSchemaKeys = new Set(getAllKeysOfNestedObject(migratedSchema))
208193
const latestSchemaKeys = new Set(getAllKeysOfNestedObject(getSchema()))
209194
const initialStateKeys = new Set(getAllKeysOfNestedObject(initialState))

apps/mobile/src/app/migrations.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from 'wallet/src/features/transactions/types'
2020
import { Account, AccountType } from 'wallet/src/features/wallet/accounts/types'
2121
import { SwapProtectionSetting } from 'wallet/src/features/wallet/slice'
22+
import { removeWalletIsUnlockedState } from 'wallet/src/state/sharedMigrations'
2223

2324
export const OLD_DEMO_ACCOUNT_ADDRESS = '0xdd0E380579dF30E38524F9477808d9eE37E2dEa6'
2425

@@ -876,10 +877,7 @@ export const migrations = {
876877
return newState
877878
},
878879

879-
63: function removeWalletIsUnlockedState(state: any) {
880-
const newState = { ...state }
881-
delete newState.wallet.isUnlocked
882-
883-
return newState
884-
},
880+
63: removeWalletIsUnlockedState,
885881
}
882+
883+
export const MOBILE_STATE_VERSION = 63

0 commit comments

Comments
 (0)