[Cashtab] [Alias] - Accept aliases as eCash address in contact list
Summary:
T2993
This diff allows the the contact list to accept aliases as the address. Contact list validation logic will check whether it's a valid ecash address first, and if not, then check whether it's an alias.
Send.js' useEffect() loop also updated to explicitly trigger address validation upon routing from contact list otherwise the mere routing to Send.js won't detect aliases that don't exist or yet to have 1 confirmation.
Test Plan:
- npm test
- enable alias in ticker.js
- npm start
- Manually add a new contact with a registered alias with at least 1 confirmation, click on the Send icon, and upon routing to Send.js, fill in the amount and ensure it sends successfully
- Manually add a new contact with a pending alias, click on the Send icon, and upon routing to the Send.js page the eCash Alias does not exist or yet to receive 1 confirmation error is displayed and Send button is greyed out
- Manually add a new contact with an alias that does not exist, click on the Send icon, and upon routing to the Send.js page the eCash Alias does not exist or yet to receive 1 confirmation error is displayed and Send button is greyed out
- Open contact list in a new browser and wallet, click on Add Contact, add a registered alias and ensure the Send button routes to Send.js with no validation errors and it sends successfully
- Choose an existing contact with an ecash address, click on Send icon and ensure no regression in sending to this standard address
- disable alias in ticker.js
- retry sending XEC to a contact with a standard ecash address and ensure no regression
- Manually add a new contact with an invalid ecash address that's not an alias and ensure the Invalid eCash address or alias validation error is triggered
- Manually add a new contact with a valid ecash address and ensure successful update to the contact list
- Manually add a new contact with a valid alias that already exists on the contact list and ensure it triggers the duplication error notification
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13609