[Cashtab] Remove legacy prefix validation functions
Summary:
T2099
Cashtab address validation developed incrementally supporting use cases specific to the migration from bitcoincash: address formats to ecash: address formats.
After improved address validation was added in D10687, some legacy validation functions that worked by checking prefixes were no longer relevant.
This diff removes these functions.
In ScanQR.js, these functions are replaced by their successor functions that validate the full address, prefix or not.
QRCode.js should have never used these functions. It has been refactored to accept address type as a prop. The switch in Wallet.js has also been refactored to work as a boolean instead of different string types.
Test Plan:
npm start
- Scan a valid XEC address and see that it populates the address field
- Scan a valid eToken address and see that it populates the address field
- Scan a valid prefixless XEC address and see that it populates the address field
- Scan a valid prefixless eToken address and see that it populates the address field
- Scan any QR code that is not a valid address and note that form is not populated
- Toggle quickly between 'XEC' and 'eToken' switch below QR code on main page. Test that it switches. Test copy pasting is functional.
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Subscribers: emack
Differential Revision: https://reviews.bitcoinabc.org/D10745