HomePhabricator

[Cashtab] [chronik utxo handling p13] Unlock SendToken screen only after utxo…

Description

[Cashtab] [chronik utxo handling p13] Unlock SendToken screen only after utxo set is updated

Summary:
T2447

Depends on D11985

The SendToken screen UI will lock after sending a token tx until the token utxo set is refreshed. The implementation under bch-api was hacky, relying on the token object as a whole to change and assuming this would include a balance change. The bch-api approach got away with this because, after implementing per-utxo updating, the token object would not change unless utxo sets changed. So it seemed to work most of the time.

The correct approach is to unlock the UI after token.balance has changed. This was not implemented previously probably because of difficulties encounted with attempting to include a sometimes-undefined variable as a dependency in a useEffect loop.

This diff unlocks the UI only after the token.balance has changed, which is the intended behavior. At a 5s refresh rate on chronik, the token object is always "changing," even when it is still serializing to the same thing.

Test Plan:
npm start
Send eToken txs
Observe that the UI of SendToken.js does not unlock until the balance has changed.

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

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

Details

Provenance
bytesofmanAuthored on Sep 14 2022, 16:16
bytesofmanPushed on Sep 20 2022, 15:27
Reviewer
Restricted Project
Differential Revision
D11986: [Cashtab] [chronik utxo handling p13] Unlock SendToken screen only after utxo set is updated
Parents
rABC0b9c63344b8f: [Cashtab] [chronik utxo handling p12] etoken send txs with chronik formatted…
Branches
Unknown
Tags
Unknown