Page MenuHomePhabricator

[Cashtab] Improve Send screen handling of address input
ClosedPublic

Authored by bytesofman on Jan 9 2024, 20:34.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCddba347572ea: [Cashtab] Improve Send screen handling of address input
Summary

Improve logic of handleAddressChange function on Send screen

Test Plan

npm test

Edit config/alias.js to set aliasEnabled to true
Navigate to the send screen and test validation for following strings

ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg6 (valid address), no error msg
ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg (invalid address and invalid alias), error msg 'invalid alias'
ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg6?amount=100 (valid address with param), no error msg
chicken.xec (valid alias), alias address displayed under input field
chicken.xe (invalid alias input), error msg 'invalid address'
chicken.xec?amount=100 (valid address with param)
chicken999999999999.xec (valid but unregistered alias), error msg 'alias not registered'

Diff Detail

Repository
rABC Bitcoin ABC
Branch
better-send-addr-validation
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26226
Build 52024: Build Diffcashtab-tests
Build 52023: arc lint + arc unit

Event Timeline

back out unrelated changes

back out unrelated comment add

bytesofman published this revision for review.Jan 9 2024, 20:42

test plan screenshots

ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg6 (valid address), no error msg

image.png (395×485 px, 20 KB)

ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg (invalid address and invalid alias), error msg 'invalid alias'

image.png (395×485 px, 22 KB)

ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg6?amount=100 (valid address with param), no error msg

image.png (395×485 px, 20 KB)

chicken.xec (valid alias), alias address displayed under input field

image.png (441×485 px, 22 KB)

chicken.xe (invalid alias input), error msg 'invalid address'

image.png (441×485 px, 22 KB)

chicken.xec?amount=100 (valid address with param)

image.png (441×485 px, 24 KB)

chicken999999999999.xec (valid but unregistered alias), error msg 'alias not registered'

image.png (441×485 px, 26 KB)

chicken999999999999.xec?amount=100 (param is parsed but still have address error msg)

image.png (441×485 px, 27 KB)

cashtab/src/components/Send/Send.js
460–461

point of the diff

better logic organization so we avoid setting and then unsetting this error

This revision is now accepted and ready to land.Jan 10 2024, 03:32