Adding support for approved address prefixes beyond the BCH standard creates complications with legacy validation libraries which only work with bitcoincash: prefix addresses (or prefix-less addresses that are checksum valid for the bitcoincash: prefix). This diff better organizes the methods needed to support this interface.
Changes
- Make the bitcoincash legacy prefix a constant as it is used in multiple places
- Rename isCash and isToken functions to be more descriptive about their functionality
- Accept no prefix as a valid prefix for cash addresses (but not token addresses)
- Remove : from approved prefix strings in input array as it applies to all prefixes
- Add unit tests