Page MenuHomePhabricator

[Cashtab] [Alias] - Accept aliases as eCash address in contact list
ClosedPublic

Authored by emack on Apr 7 2023, 05:33.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
aliasContacts
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23062
Build 45744: Build Diffcashtab-tests
Build 45743: arc lint + arc unit

Event Timeline

emack requested review of this revision.Apr 7 2023, 05:33
bytesofman added inline comments.
cashtab/src/components/Configure/Configure.js
1221

I think not enough to check for valid alias format. Also need to confirm it is a registered and valid alias.

This revision now requires changes to proceed.Apr 12 2023, 14:57
emack marked an inline comment as done.

alias rego status parsing now added to contact list address input validation

bytesofman added inline comments.
cashtab/src/components/Send/Send.js
240 ↗(On Diff #39725)

is this needed because of this change, or is this something that should have been there already? what problem is this solving?

cashtab/src/utils/chronik.js
98 ↗(On Diff #39725)

this is better, but also unrelated to this diff

This revision now requires changes to proceed.Apr 14 2023, 12:03
emack requested review of this revision.Apr 14 2023, 12:16
emack added inline comments.
cashtab/src/components/Send/Send.js
240 ↗(On Diff #39725)

This is needed as part of this change otherwise clicking the send icon on the contact list and routing to the Send screen will result in a scenario where the alias is invalid but the validation is not triggered. Thus enabling the user to click send only to then receive a less user friendly error from chronik/node.

cashtab/src/utils/chronik.js
98 ↗(On Diff #39725)

related in the sense that isAliasRegistered is called as part of inputting the alias into the contact list address field. Having a generic debug statement like this will cater to both contact list input and pre-registration check for alias status.

This revision is now accepted and ready to land.Apr 14 2023, 14:19