Page MenuHomePhabricator

[Cashtab] [Alias] pt 6.1.1 - Apply Promise.All approach for alias history retrieval
ClosedPublic

Authored by emack on Jan 23 2023, 05:38.

Details

Summary

T2551

Depends on D13018

Applying the Promise.All approach from https://reviews.bitcoinabc.org/D13018 for retrieving the full tx history from the alias payment address across the following functions:

  • isAliasAvailable() - updated to use getAllTxHistory() instead of getAliasPaymentHistory()
  • getAliasPaymentHistory() - function removed now that getAllTxHistory() retrieves the full history
  • getAliases() - adjusted parsing logic to reflect the updated JSON response from getAllTxHistory() (txs object array is now at the top level)

No changes needed for isAliasRegistered() & getAddressFromAlias() as they didn't reference any JSON params.

[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 and attempt to register an existing alias, ensure error is displayed indicating it is taken
  • register a new alias
  • navigate away and then back to the Alias page and verify the tx count has been incremented by 1

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested review of this revision.Jan 23 2023, 05:38
This revision is now accepted and ready to land.Jan 23 2023, 18:11