-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport upstream bech32m implementation & implement converttex
RPC method.
#6891
Conversation
9fb1d00
to
13b4cbe
Compare
(cherry picked from commit bitcoin/bitcoin@60f61f9)
(cherry picked from commit bitcoin/bitcoin@2457aea)
Added are: * Vector(arg1,arg2,arg3,...) constructs a vector with the specified arguments as elements. The vector's type is derived from the arguments. If some of the arguments are rvalue references, they will be moved into place rather than copied (which can't be achieved using list initialization). * Cat(vector1,vector2) returns a concatenation of the two vectors, efficiently moving elements when relevant. Vector generalizes (and replaces) the Singleton function in src/descriptor.cpp, and Cat replaces the Cat function in bech32.cpp (cherry picked from commit bitcoin/bitcoin@e65e61c)
(cherry picked from commit bitcoin/bitcoin@da2bb69)
(cherry picked from commit bitcoin/bitcoin@0334602)
(cherry picked from commit bitcoin/bitcoin@b8cd2a4)
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.
Concept ACK 90888c6. Documentation fixes are blocking, the rest is a soft block (can be overridden by another reviewer disagreeing with me).
test_vectors = [ | ||
["tmQqjg2hqn5XMK9v1wtueg1CpzGbgTNGZQu", "texregtest15hhh9uprfp6krumprglg6qpx3928ulrnlxt9na"], | ||
["tmGiqpWKPJdraF2PqBzPojzkRbDE4fPTyAF", "texregtest1fns2jk8xpjr7rqtaggn2zpmcdtfyj2jer8arm0"], | ||
["tmEkTF6UovNsEQM9h1ehnA3byw6yhFCJWor", "texregtest1xulx2a0pgc84phkdtue67zwe26axtcvvyaf6yu"], | ||
["tmGoyC4XZ1GNCdJGk96K6mT8jxDQEhzVbfR", "texregtest1fhvw29vvg37mep5kkhyew47rrqadjtyk4xzx8n"], | ||
["tmG4gSmUZzCcyR6S5nBhEFrfmodmUjXXAZG", "texregtest1gk5swlnzf8m5hc9x82344aqv5s90k5x2dvqyvh"], | ||
["tmKgnRCv6SjwEFgXhqPoADKp3HLFF67Seww", "texregtest1d4j4uz8wnl5zmuzdl7y3fykrkk2zarnccfs578"], | ||
["tmTymg9bGECw8tR8WHepE45c4joNTUt1zth", "texregtest1epwdxsm94e9wh2zwad7j885gelxly2f8d4mqry"], | ||
["tmMGGBngBJwgTYWCx23zWDY7QvLateZNqCC", "texregtest106exvc6ufugdwppy7vnuf2vwztf5qh9r4tpsfa"], | ||
["tmUyukTGWjTM7Nw4j8zgbZZwPfM8enu9NvZ", "texregtest16ddmp690el6vrzajhftc3fqpmx4a3cgfqf97yn"], | ||
["tmDsJSojZxU3sb3LGMs6nMC1SVSQhKD99My", "texregtest19kgadp7hwu08xlufnvr2r0p5aygw3ss60px28u"], | ||
["tmWezycaJjPoXNJxK2zvzELjS65mzExnvVE", "texregtest1ukuxwrfrj20q65c25ssk3nkathsy8qneehv5vl"], | ||
["tmMUEbcXX7tVwtRjaSaMVfzXu6PCeyMnsCH", "texregtest1srmppx752ux07mntsjmthpddy2enunfuh6mlej"], | ||
["tmDjbRj8go7BrS8AxSjfjTBsCcHw7J45SCi", "texregtest19sw2lplpdswc4zvdtz3z8yt42wtz4recz5plym"], | ||
["tmSSJADGK9bgafaY9eih17WRazi3KzNL7RT", "texregtest1kacdt4amhphqx6tf4gla7a4qg8h9ey5tauz24v"], | ||
["tmSJ3JSRx2R71MfBksWzHNEfMxUgzMxDMxy", "texregtest1khs34j6m944un75ula8xxgvgdnjc4m2l0kfgpy"] | ||
]; |
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.
I did not check these.
Co-authored-by: str4d <thestr4d@gmail.com>
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.
utACK 069ed75. Should be mentioned in the release notes, but that doesn't have to happen in this PR.
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.
Re-utACK fa3af5f
if (c >= 'a' && c <= 'z') lower = true; | ||
if (c >= 'A' && c <= 'Z') upper = true; | ||
else if (c >= 'A' && c <= 'Z') upper = true; | ||
else if (c < 33 || c > 126) return {}; | ||
} | ||
if (lower && upper) return {}; |
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.
We don't currently expose any way to decode a TEX address from zcashd, but if we did, it would be necessary to check that all-uppercase addresses are accepted (but not generated). The test vectors don't have any examples of all-uppercase addresses. Note that they may occur in practice because an all-uppercase alphanumeric string is more efficiently represented in a QR code.
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.
Post-hoc ACK, with a comment.
Includes changes cherry-picked from the following upstream PRs:
src/bech32.cpp
.src/outputtype.cpp
(we haven't backported Update createmultisig RPC to support segwit bitcoin/bitcoin#13072 and didn't look further back).src/script
(we haven't backported Support output descriptors in scantxoutset bitcoin/bitcoin#13697).src/txdb.cpp
(we haven't backported Use non-atomic flushing with block replay bitcoin/bitcoin#10148).src/bench/bech32.cpp
andsrc/test/fuzz/bech32.cpp
(we haven't backported these).