HomePhabricator

[Cashtab] [Alias-server] - pt 2 - Incorporate pending aliases endpoint

Description

[Cashtab] [Alias-server] - pt 2 - Incorporate pending aliases endpoint

Summary:
T3003

Depends on D13367

This diff implements the pending endpoint via the new getPendingAliases and appendWithPendingAliases functions. The Registered Aliases list will now be based on the following logic:

  • user registers a new alias
  • upon successful tx broadcast, cashtab retrieves pending list from endpoint
  • adds '(pending)' to each pending alias retrieved
  • filters out ones not related to this wallet
  • updates the state variable in Alias.js (activeWalletAliases) that tracks the aliases to be displayed under Registered Aliases, simultaneously removing duplicates
  • if user is subsequently navigating to Alias.js again, the useEffect loop will call appendWithPendingAliases again to ensure it reflects the latest pending state

Note: refer to tg chat regarding current issue with the pending endpoint. Otherwise the diff should be displaying the correct pending aliases.

Test Plan:

  • enable alias in ticker.js
  • npm start
  • register a new alias and ensure it gets listed under Registered Aliases on Alias.js with (pending) appended to name
  • navigate to home then navigate to Alias.js to ensure the useEffect() logic does not lose the newly added pending aliases
  • ensure the pending aliases match what is on https://aliasdev.etokens.cash/pending
  • switch to another wallet, register a new alias, note it's appearance on the pending endpoint
  • switch back to original wallet, navigate to Alias.js and ensure the alias registered with the other wallet is not displayed as pending
  • wait for a new block to be found and ensure the previously pending alias no longer has the (pending) text and can is now active

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Mar 25 2023, 09:58
emackPushed on Mar 27 2023, 00:59
Reviewer
Restricted Project
Differential Revision
D13463: [Cashtab] [Alias-server] - pt 2 - Incorporate pending aliases endpoint
Parents
rABC7072dcbe66dc: [Cashtab] [Alias-server] - pt 1 - Alias server api integration
Branches
Unknown
Tags
Unknown