HomePhabricator

[Cashtab] Load from cache on startup

Description

[Cashtab] Load from cache on startup

Summary:
Building on D9393, this diff now adds utxo information to the cached wallet state. On app start, if the wallet has a cached state and utxo set is unchanged, the app pulls this in rather than querying server for full history.

Because BigNumber type information is lost in the caching to IndexedDb, a helper function is added to convert cached token utxo info back to what is calculated in the app. This function includes a unit test.

Test Plan:
npm test

npm start
Switch between wallets and check for any strange behavior
Load time should be improved after you are reloading a wallet that has cached its utxo info

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9424

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Apr 15 2021, 14:24
bytesofmanPushed on Apr 20 2021, 17:58
Reviewer
Restricted Project
Differential Revision
D9424: [Cashtab] Load from cache on startup
Parents
rABC8ef7cf94d1d8: [net] Make cs_inventory nonrecursive
Branches
Unknown
Tags
Unknown

Event Timeline