Page MenuHomePhabricator

[Cashtab] Support param parsing in QR scanned addresses
ClosedPublic

Authored by kieran709 on Mar 17 2022, 18:47.

Details

Summary

Related to task T2313. Added check for param parsing in QR scanned addresses. In the parseContent function in ScanQrCode.js, there is a check for '?', if one is present, the string will be split on the '?' allowing the valid address to be parsed normally.

Test Plan

cd web/cashtab && npm start
Navigate to send tab

On another device, generate a QR code that contains a valid eCash address with params added to the end

scan the QR code from the machine running this patch and observe the address field populate with the correct address

Repeat preceding two steps with a valid eToken address incl params

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This works in that it will allow a user to scan a QR code with params. But we'd also like to support the params.

For the purposes of this diff, it's okay to just pass all the text into the field if it includes a ? and the preceding address is valid, because the Send.js screen validates for params supported by Cashtab (...test to make sure).

I've created a task to add more sophisticated validation function (T2318), but this diff can land before that is ready.

This revision now requires changes to proceed.Mar 17 2022, 19:46

responding to review feedback

This revision is now accepted and ready to land.Mar 22 2022, 00:01