HomePhabricator

[Cashtab] [chronik tx history p20] update token info cache in tx history routine

Description

[Cashtab] [chronik tx history p20] update token info cache in tx history routine

Summary:
T2447

Depends on D12148

Update token info cache in tx history

I thought this wouldn't be necessary because the token info cache is updated by utxos immediately before tx history is called. However, I fortunately discovered an edge case. You can have a situation where

  1. Cashtab user in Cashtab wallet Alpha in browser Alpha receives eToken Alpha
  2. Cashtab user in Cashtab wallet Alpha in browser Alpha burns eToken Alpha or sends it away
  3. Cashtab user opens Cashtab wallet Alpha in browser Beta. Now that etoken is not in the wallet utxos nor is it in cache of browser Beta. But it's in the tx history. If this isn't handled, it will never be added to cache, and the tx history will not have token decimals, so it will be rendered incorrectly.

This diff uses a similar approach to that used in the chronik utxo implementation.

Test Plan:
Review code changes
Execute the steps above (1, 2, 3)
Check the dev console to verify that Uncached token info found in tx history, adding to cache appears and the token txs are rendered correctly in tx history after ~10 seconds

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

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

Details

Provenance
bytesofmanAuthored on Oct 5 2022, 22:16
bytesofmanPushed on Oct 6 2022, 13:49
Reviewer
Restricted Project
Differential Revision
D12158: [Cashtab] [chronik tx history p20] update token info cache in tx history routine
Parents
rABC6600ead38e40: [Cashtab] [chronik tx history p19] remove legacy object from tx parsing
Branches
Unknown
Tags
Unknown