HomePhabricator

[Cashtab][Alias] Utilize existing isValidAliasString to gatekeep alias status…

Description

[Cashtab][Alias] Utilize existing isValidAliasString to gatekeep alias status checks

Summary:
T3363

The alias input status check should leverage the existing isValidAliasString function's regex to weed out all instances of non-alphanumeric inputs (e.g. capital letters, spaces, symbols, non-english characters).

The else block here is also removed to prevent the scenario where an available alias overrides the invalid alias input error.

Test Plan:
npm test
npm start
Ensure the following alias input permutations match the expected outcome:

  • Valid input + unregistered alias = byte size and price message displayed
  • Valid input + registered alias = Alias taken error displayed
  • Invalid input (capital letter) + unregistered alias = invalid input error
  • Invalid input (space) + unregistered alias = invalid input error
  • Invalid input (% symbol) + unregistered alias = invalid input error
  • Invalid input (字 non-english char) + unregistered alias = invalid input error
  • Invalid input (capital letter) + registered alias = invalid input error
  • Invalid input (space) + registered alias = invalid input error
  • Invalid input (% symbol) + registered alias = invalid input error
  • Invalid input (字 non-english char) + registered alias = invalid input error
  • Enter an input, then delete the input = invalid input error

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Dec 6 2023, 13:31
emackPushed on Dec 6 2023, 13:46
Reviewer
Restricted Project
Differential Revision
D14923: [Cashtab][Alias] Utilize existing isValidAliasString to gatekeep alias status checks
Parents
rABC958de2b2d9e2: [Cashtab] Validate multisend amounts for decimal places
Branches
Unknown
Tags
Unknown