This repository has been archived by the owner on Jul 15, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO it's not enough to only test for the
bitcoincash:
prefix, especially since it collides with the URI scheme used in QR Codes (see #60 ):bitcoincash:<addr>
rather thanbitcoincash:bitcoincash:<addr>
would not be caught by this testbitcoincash:
prefix or users only copying the last part of the address would not be caught eitherbitcoincash:
URI scheme would trigger a not supported errorThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so technically it would still catch if you manually copy paste in that field. only the QR code scanning can have a problem.
I kinda wonder if we should just make the qrcode scanner preserving
bitcoincash:*
as the recipient, meaning we will not supportbitcoincash:*
as a "uri scheme" qrcode bit will assume it's an address part alreadythe code to modify would be in URIScheme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless of the QR issue (the official specs require to not have a double prefix in this context btw), using CashAddr without prefix is not uncommon and should be handled: Bitcoin ABC own CashAddr announcement states:
EDIT: It's also in the specs: When presented to users, the prefix may be omitted
Why not use the reference
bitcoincashjs
lib to test the address format?https://github.com/bitcoincashjs/bchaddrjs#test-for-address-format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more libcore that should provide a way to do that. live-common is supposed to be as agnostic as possible & we will try to drop dep like ripple-lib and ethereumjs-tx