HomePhabricator

[Cashtab] [chronik utxo handling p14] Force update to chronik format of utxo…

Description

[Cashtab] [chronik utxo handling p14] Force update to chronik format of utxo storage before wallet can be used

Summary:
T2447

Depends on D11986

This diff removes the obsolete hydratedUtxoDetails key from wallet.state as a way to distinguish a chronik migrated wallet from a legacy bch-api wallet.

This allows the app to use existing functions to wait for the wallet's state to be updated to chronik before the user can use it, preventing errors from being thrown by trying to create transactions using bch-api formatted utxos.

Ultimately, the chronik migration wallet will have a much different structure. However this is handled in a different task and will require it's own stack. This approach will allow bch-api to be deprecated in the utxo battery. Optimization can come later.

Test Plan:
npm start
Check dev console
Note dev console msg Active wallet is not valid, loading params from API
Note that UI locks while wallet loads
Check local storage and confirm that hydratedUtxoDetails is no longer in wallet.state
Send some txs
Change to a saved wallet
Note dev console msg Saved wallet is not valid, loading with latest parameters
Note that UI locks while wallet loads
Check local storage and confirm that hydratedUtxoDetails is no longer in wallet.state
Switch back to original wallet and note absence of dev console msg and faster loading

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

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

Details

Provenance
bytesofmanAuthored on Sep 14 2022, 17:09
bytesofmanPushed on Sep 20 2022, 15:27
Reviewer
Restricted Project
Differential Revision
D11987: [Cashtab] [chronik utxo handling p14] Force update to chronik format of utxo storage before wallet can be used
Parents
rABC666745a5e369: [Cashtab] [chronik utxo handling p13] Unlock SendToken screen only after utxo…
Branches
Unknown
Tags
Unknown