AlphaWallet / AlphaWallet/alpha-wallet-android

Normalise Realm storage for Tokens

Đang mở
#2,584 0 bình luận 0 reaction 1 người được giao Được @asif-finimble nhận Xem trên GitHub
Ngôn ngữ chính
Java
Star
646
Fork
579
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.