Disable SEI cosmos chain - #883
Conversation
DRadmir
left a comment
There was a problem hiding this comment.
Sei is only filtered in two places (allChains on iOS and available() on Android), but many places still use Chain.allCases / Chain.entries directly for example token search, transactions filter, contact chain select. So Sei can still appear there.
I suggest a different approach: add a "discontinued" flag to the chain config in core, and write a generic cleanup on each platform that runs on app start: for every discontinued chain it deletes accounts/addresses/nodes and disables assets. This cleanup is data-only, the schema does not change, so we don't need DB migrations at all.
We write this logic once, and next time we disable a chain it is only one flag in core no new migrations
Also, deleting accounts can leave a wallet with zero accounts
gemcoder21
left a comment
There was a problem hiding this comment.
it should be generic solution, for any chain
|
@DRadmir we still need to have a place to filter |
DRadmir
left a comment
There was a problem hiding this comment.
We delete wallets with raw SQL, but this skips the normal wallet delete flow (WalletService.delete on iOS, DeleteWalletImpl on Android). So for Sei-only wallets we leave data: private keys, wallet preferences, and the avatar too. Maybe we should delete these wallets through the normal wallet delete path?
Small thing: Chain::all() in Rust is not filtered, so core/backend still see Sei as enabled. Is that intended?
|
@DRadmir good suggestion, let me apply |
bfb333a to
4ee8593
Compare
gemcoder21
left a comment
There was a problem hiding this comment.
This should handle removal of chain case on the clients, sei should be marked as skip generation for typeshare. Once user launches the app it removed any references of that chain once, and never checks inside the app
|
once that change is made, there is many others that does not need renaming or adjustments, less code and much more reliable and long term solution to remove any unused stuff. |
| override fun toString(): String = "$sql | ${arguments.joinToString()}" | ||
| } | ||
|
|
||
| internal fun chainRemovalStatements(chain: String): List<MigrationStatement> { |
There was a problem hiding this comment.
chainRemovalStatements move this to reusable function somewhere? so could be used in the future
| try? db.execute(sql: "DELETE FROM \(AssetRecord.databaseTableName) WHERE chain = ?", arguments: [chain]) | ||
| } | ||
|
|
||
| static func removeChains(_ db: Database, chains: Set<String>) throws { |
There was a problem hiding this comment.
there is clearChainData - can you consolidate that? should we check if table exist first?
| #[test] | ||
| fn test_deployment_addresses_are_checksummed() { | ||
| for chain in Chain::all() { | ||
| for chain in Chain::all_with_disabled() { |
There was a problem hiding this comment.
can we remove all_with_disabled? just exclude sei in all()
Remove the empty-wallet deletion flow and simplify chain handling. Deleted/streamlined DeleteWallet API (no boolean return, no deleteEmptyWallets), removed avatar file deletion and moved LocalStore into the wallet-details feature, and updated DI to match. WalletsRepository/DAO no longer expose getEmptyWallets; tests adapted. iOS OnstartService/WalletService no longer call deleteEmptyWallets. Core chain logic: mark Sei as deprecated, remove is_disabled/all_with_disabled, and make Chain::all exclude Sei; callers updated to use Chain::all. Small related test updates and cleanup across Kotlin/Swift/Rust modules.
Remove legacy 'sei' references and preserve SeiEVM (seievm) across platforms. Key changes: refactor DB migration to remove 'sei' (Migration_85_86), add Android instrumentation test for migration, update iOS migration/tests and rename seievm assets to sei.svg, map Chain.SeiEvm icon to sei.svg, switch many call sites to Chain.available() and safer Chain lookups (entries.firstOrNull), update various repository and test logic, and add small core/rust test ensuring legacy Sei is excluded. Misc. formatting and minor API cleanups.
Rename the 'sei' chain assets and references to 'seievm', update icon mappings, and centralize chain removal logic.
Key changes:
- Added SupportSQLiteDatabase.removeChain helper to delete all DB refs for a chain using GLOB JSON-safe patterns.
- Migration_85_86 now calls db.removeChain("sei").
- Updated Android IconUrlGeneration and tests to use seievm asset name.
- Renamed Android/iOS chain icon assets and updated Images/ChainImage mapping.
- Adjusted migration tests to assert new wallets_connections/in_app_notifications ids.
This ensures consistent handling of the Sei EVM chain and safer JSON matching during removals.
Disables Sei Cosmos while preserving its Rust enum and database compatibility.
#[typeshare(skip)], so generated iOS and Android enums no longer expose the discontinued chain while Core can still decode existing values."sei"identifier to transactionally remove chain references.seievmname.The migration helpers accept a set of raw chain identifiers, providing a generic method to disable future chains without adding client enum cases or permanent runtime filtering.
Validated with the Android Store migration test and assembly, plus the iOS Store test suite.