AlphaWallet / AlphaWallet/alpha-wallet-android
Normalise Realm storage for Tokens
- Lenguaje dominante
- Java
- Estrellas
- 646
- Forks
- 579
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
This is a large-ish project to optimise storage of tokens esp for multi-wallet apps.
It also has a number of other advantages eg new wallets benefit from previous wallet's discovered tokens.
The current structure looks like this:
## RealmToken
### Static Data
- address-chain
- name
- symbol
- group
- interface Spec (erc20/erc721 etc)
- decimals
- auxData
### Dynamic Data
- addedTime;
- updatedTime;
- balance
- isEnabled
- lastBlockRead
- earliestTxBlock
- visibilityChanged
### Deprecated (can be deleted)
- erc1155BlockRead
- tokenId
This update should create a separate, singleton database which contains the static data. The per wallet dynamic databases should only contain the dynamic data above.
In this way two new schemas should be used; RealmStaticToken and RealmWalletToken. RealmToken will be deprecated, but left in place for migration.
When the database is upgraded (AWRealmMigration) you should trigger a one-time migration (using statics to set a flag in TokensService, that gets picked up when TokensService is initialised is fine). This migration would go through all the wallets, strip out all the data in RealmToken, and populate the respective RealmWalletToken, and add to the global RealmStaticToken database as appropriate.
This update will touch a fair few files, but since most token fetches are via TokensService and the fetchTokenMetas methods these usages are mostly centralised (but not entirely - there are a fair few listeners that will need updating - note for listeners you'll be listening for changes to the respective RealmWalletToken DB).
When you fetch tokens you'll need to combine data from the StaticToken and WalletToken realms.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.