HomePhabricator

[Cashtab] [Alias] pt 11 - Enable alias input for Send Token txs

Description

[Cashtab] [Alias] pt 11 - Enable alias input for Send Token txs

Summary:
T2551

This is a standalone diff that enables the use of aliases for etoken transactions. Adopts the same approach as sending XEC txs via aliases.

[Cashtab] [Alias] pt 1 - Create scaffold for new Alias 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 - Update getAliases() to extract both alias and address
[Cashtab] [Alias] pt 6.5 - Optimize getAllTxHistory to only make API calls for uncached tx history pages
[Cashtab] [Alias] pt 6.6 - Render list of Aliases owned by active wallet in Alias.js
[Cashtab] [Alias] pt 7 - Mitigate edge cases for registration records
[Cashtab] [Alias] pt 8 - Activation flag in prod
[Cashtab] [Alias] pt 9 - Retain tokenInfoById upon alias validation
--stacked diff cutoff--
[Cashtab] [Alias] pt 10 - Enable alias inputs for one to one Send XEC txs
[Cashtab] [Alias] pt 11 - Enable alias inputs for Send Token txs
[Cashtab] [Alias] pt 12 - Upgrade tx history to recognize alias registration txs
[Cashtab] [Alias] pt 13 - Port Alias feature to Cashtab extension
--closed beta--
[Cashtab] [Alias] pt 14 - Pre-prod update (p2sh update, set final registration fees, remove residual dev logs and enable prod flag)
--post mvp---
[Cashtab] [Alias] - Enable alias parsing without the .xec extension
[Cashtab] [Alias] - Optimize isAliasAvailable to take cached tx history as input
[Cashtab] [Alias] - Add active wallet's aliases to caching mechanism

Test Plan:

  • npm test
  • set aliasEnabled to true
  • npm start
  • navigate to Send Token component, input an alias address (with .xec) that is registered onchain, then verify validation passes and parsed address is displayed in the console log. Send an eToken amount with this input and verify successful broadcast via explorer
  • input a valid alias address (with .xec) that has yet to be registered onchain, then verify validation fails with the eCash Alias does not exist message displayed in the address input field UI.
  • input foo.xec (already registered), then immediately change it to an invalid alias format and ensure it fails validation
  • input foo.xec, then immediately change it to an unregistered alias format and ensure it fails validation
  • ensure sending token via ecash address or etoken address has not regressed
  • verify the placeholder text for the address input field shows Address or Alias
  • set aliasEnabled to false and verify the placeholder text for the address input field only shows Address
  • verify no alias cache updates on app load and no alias menu option

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Feb 24 2023, 07:12
emackPushed on Feb 24 2023, 20:41
Reviewer
Restricted Project
Differential Revision
D13166: [Cashtab] [Alias] pt 11 - Enable alias input for Send Token txs
Parents
rABC29e9d48bb254: Remove unused block height in mempool removeForBlock
Branches
Unknown
Tags
Unknown