|
4 | 4 | DEFAULT_CHAIN_CONFIGURATIONS,
|
5 | 5 | DEFAULT_MAX_PARALLEL_API_REQUESTS,
|
6 | 6 | getDefaultPersistedNetwork,
|
| 7 | + getOfficialNodes, |
7 | 8 | IIscpChainMetadata,
|
8 | 9 | NetworkId,
|
9 | 10 | } from '@core/network'
|
@@ -75,6 +76,7 @@ const persistedProfileMigrationsMap: Record<number, (existingProfile: unknown) =
|
75 | 76 | 16: persistedProfileMigrationToV17,
|
76 | 77 | 17: persistedProfileMigrationToV18,
|
77 | 78 | 18: persistedProfileMigrationToV19,
|
| 79 | + 19: persistedProfileMigrationToV20, |
78 | 80 | }
|
79 | 81 |
|
80 | 82 | function persistedProfileMigrationToV4(existingProfile: unknown): void {
|
@@ -352,3 +354,23 @@ function persistedProfileMigrationToV19(existingProfile: IPersistedProfile): voi
|
352 | 354 | existingProfile.network.chains = newChains
|
353 | 355 | saveProfile(existingProfile)
|
354 | 356 | }
|
| 357 | + |
| 358 | +/* |
| 359 | + * Migration 20 |
| 360 | + * Remove Tanglebay SMR node from the list of nodes. |
| 361 | + */ |
| 362 | +function persistedProfileMigrationToV20(existingProfile: IPersistedProfile): void { |
| 363 | + const DEPRECATED_NODE_URL = 'https://shimmer-node.tanglebay.com' |
| 364 | + const OFFICIAL_NODES = getOfficialNodes(existingProfile.network.id) |
| 365 | + |
| 366 | + const nodes = existingProfile.clientOptions.nodes ?? [] |
| 367 | + existingProfile.clientOptions.nodes = nodes.filter((node) => node.url !== DEPRECATED_NODE_URL) |
| 368 | + if (!existingProfile.clientOptions.nodes?.length) { |
| 369 | + existingProfile.clientOptions.nodes = OFFICIAL_NODES |
| 370 | + } |
| 371 | + const primaryNode = existingProfile.clientOptions.primaryNode |
| 372 | + if (primaryNode?.url === DEPRECATED_NODE_URL) { |
| 373 | + existingProfile.clientOptions.primaryNode = undefined |
| 374 | + } |
| 375 | + saveProfile(existingProfile) |
| 376 | +} |
0 commit comments