HomePhabricator

[Cashtab] [Alias] pt 6.2 - Implement getAliasesFromLocalForage

Description

[Cashtab] [Alias] pt 6.2 - Implement getAliasesFromLocalForage

Summary:
T2551

Depends on D13019

This diff implements the logic in Alias.js which determines whether the alias cache object needs to be refreshed based on the last cached total tx count vs the onchain total tx count of the alias payment address.

At this point in the stack, this will always result in the need for a refresh since the updating of local forage will be implemented in the next diff.

[Cashtab] [Alias] pt 1 - Create scaffold for new Identity component
[Cashtab] [Alias] pt 2 - Upgrade sendXec() to handle alias registration
[Cashtab] [Alias] pt 3 - Implement isAliasAvailable function
[Cashtab] [Alias] pt 4 - Implement isAddressRegistered function
[Cashtab] [Alias] pt 5 - Implement getAddressFromAlias function
[Cashtab] [Alias] pt 6.1 - Get latest alias tx count from payment address
[Cashtab] [Alias] pt 6.1.1 - Apply Promise.All approach for alias history retrieval
[Cashtab] [Alias] pt 6.2 - Implement getAliasesFromLocalForage
[Cashtab] [Alias] pt 6.3 - Implement updateAliases
[Cashtab] [Alias] pt 6.4 - Implement setAlisesToLocalForage
[Cashtab] [Alias] pt 6.5 - Deprecate caching related mocks and @TODOs
[Cashtab] [Alias] pt 7 - Enable alias lookup for Send XEC component
[Cashtab] [Alias] pt 8 - Enable alias lookup for Send Token component
[Cashtab] [Alias] pt 9 - Implement pricing mechanism
[Cashtab] [Alias] pt 10 - Server cron job
[Cashtab] [Alias] pt 11 - Upgrade tx history to recognize alias registration txs

Test Plan:

  • npm test
  • npm start
  • navigate to the Alias page
  • note the passingloadstatus now that there are non-trivial logic being executed in useEffecT()
  • note the console log showing an alias refresh is required

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Jan 23 2023, 12:28
emackPushed on Feb 22 2023, 04:05
Reviewer
Restricted Project
Differential Revision
D13025: [Cashtab] [Alias] pt 6.2 - Implement getAliasesFromLocalForage
Parents
rABC8c665d9bc9f6: [Cashtab] [Alias] pt 6.1.1 - Apply Promise.All approach for alias history…
Branches
Unknown
Tags
Unknown