-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e63799e
commit 383e239
Showing
7 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/shared/src/lib/core/profile/constants/profile-version.constant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { AppStage } from '@core/app/enums' | ||
|
||
export const PROFILE_VERSION: Record<AppStage, number> = { | ||
[AppStage.ALPHA]: 25, | ||
[AppStage.ALPHA]: 26, | ||
[AppStage.BETA]: 1, | ||
[AppStage.PROD]: 15, | ||
[AppStage.PROD]: 16, | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/shared/src/lib/core/profile/migrations/alpha/alpha-profile-migration-25-to-26.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { IIscChainConfiguration } from '@core/network' | ||
import { KNOWN_EVM_NETWORKS_CONFIGURATIONS } from '@core/network/constants' | ||
import { IPersistedProfile } from '@core/profile/interfaces' | ||
|
||
export function alphaProfileMigration25To26(existingProfile: unknown): Promise<void> { | ||
const profile = existingProfile as IPersistedProfile | ||
|
||
const chainConfigurations = profile.network.chainConfigurations as (IIscChainConfiguration & { | ||
explorerUrl?: string | ||
})[] | ||
chainConfigurations.forEach((chainConfiguration) => { | ||
delete chainConfiguration.explorerUrl | ||
chainConfiguration.explorer = KNOWN_EVM_NETWORKS_CONFIGURATIONS.find( | ||
(networkConfiguration) => networkConfiguration.id === chainConfiguration.id | ||
)?.explorer | ||
}) | ||
|
||
return Promise.resolve() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/shared/src/lib/core/profile/migrations/prod/prod-profile-migration-15-to-16.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { IIscChainConfiguration } from '@core/network' | ||
import { KNOWN_EVM_NETWORKS_CONFIGURATIONS } from '@core/network/constants' | ||
import { IPersistedProfile } from '@core/profile/interfaces' | ||
|
||
export function prodProfileMigration15To16(existingProfile: unknown): Promise<void> { | ||
const profile = existingProfile as IPersistedProfile | ||
|
||
const chainConfigurations = profile.network.chainConfigurations as (IIscChainConfiguration & { | ||
explorerUrl?: string | ||
})[] | ||
chainConfigurations.forEach((chainConfiguration) => { | ||
delete chainConfiguration.explorerUrl | ||
chainConfiguration.explorer = KNOWN_EVM_NETWORKS_CONFIGURATIONS.find( | ||
(networkConfiguration) => networkConfiguration.id === chainConfiguration.id | ||
)?.explorer | ||
}) | ||
|
||
return Promise.resolve() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters