AlphaWallet / AlphaWallet/alpha-wallet-android

Normalise Realm storage for Tokens

オープン
#2,584 コメント 0 件 リアクション 0 件 担当者 1 名 @asif-finimble が担当を希望しています GitHub で見る
主要言語
Java
スター
646
フォーク
579
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。