[Cashtab] [Alias] Enforce alphanumeric inputs
Summary:
T2551
As per feedback from beta testing, the initial release will be limited to lowercase alphanumeric inputs.
Test Plan:
- enable Alias in ticker.js
- npm start
- navigate to Alias.js and ensure lowercase a-z and 0-9 inputs within 21 bytes are all accepted and successfully registered
- ensure zero-width spaces, special characters, non-english characters and emojis are invalid.
*new tests*
- open a wallet that has registered non-alphanumeric aliases prior to this diff
- observe console log message Non-alphanumeric alias detected in cache, resetting aliasCache and a full alias tx history retrival is triggered
- navigate to Alias.js and ensure the registered list only shows alphanumeric aliases
- register a new alias and ensure only partial alias tx history retrieval is triggered
- inspect aliasCache in localforage and ensure no non-alphanumeric aliases in alias array. Also note the size of paymentTxHistory being much larger than aliases due to the invalidation of previously valid non-alphanumeric aliases.
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13278