This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Commit b4ab2b6
authored
Add externalId to Wallet and migrate wallet IDs (#1623)
* Add externalId to Wallet and migrate wallet IDs
Introduces an externalId field to the Wallet model and related records, updates all usages to support the new identifier, and adds a migration to convert existing wallet IDs to a new WalletIdentifier format. Also updates child table references and current wallet preference accordingly. AssetMarket and PriceRecord are updated to support new all-time high/low percentage fields.
* Add keystoreId computed property to Wallet extension
Introduces a keystoreId property to the Wallet extension, returning externalId if available, otherwise falling back to id.
* Add WalletIdMigration tests and update migration logic
Introduces comprehensive tests for WalletIdMigration covering various wallet types, duplicate handling, child table updates, and preference migration. Updates Wallet.mock to support externalId and refines migration logic to temporarily disable foreign key constraints during ID updates.
* Add wallet externalId and migrate wallet IDs
Registers migrations to add an externalId column to the wallet table and to migrate wallet IDs to the WalletIdentifier format.
* Refactor WalletIdMigration to accept UserDefaults
WalletIdMigration now takes a UserDefaults instance for preference migration, improving testability and flexibility. Tests updated to use a mock UserDefaults, and WalletStore gains a setOrder method for setting wallet order in tests.
* Update core
* Refactor wallet ID handling to use WalletIdentifier
Replaces wallet type-based ID logic with WalletIdentifier throughout keystore and primitives. Updates import and migration flows to use the new identifier format, ensuring consistent wallet identification. Adjusts tests and migration logic to support the new ID scheme and migrates wallet preferences accordingly.
* Update unit test targets in xctestplan
Reordered and updated the list of test targets in unit_frameworks.xctestplan to reflect current project structure. Added, removed, and rearranged test targets for improved test coverage and organization.
* Skip migration if wallet mappings are empty
Adds a check to return early from the migrate function if no wallet mappings are found, preventing unnecessary execution of migration steps.
* Refactor notification handling to simplify wallet ID usage
Updated notification services and store to pass notifications directly without mapping wallet IDs, simplifying the API and reducing unnecessary transformations. Adjusted related methods and models to accommodate this change.1 parent 553d03c commit b4ab2b6
File tree
23 files changed
+860
-193
lines changed- GemTests
- Packages
- FeatureServices
- NotificationService
- WalletService
- Keystore
- Sources
- Extensions
- Store
- Tests
- PrimitivesComponents/Sources/Components
- Primitives
- Sources
- Extensions
- TestKit
- Store
- Sources
- Migrations
- Models
- Stores
- Types
- Tests/StoreTests
23 files changed
+860
-193
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
0 commit comments