Finish address encoding cleanup#2414
Merged
Merged
Conversation
cc44f9d to
5c39626
Compare
Author
|
Rebased after #2359 merge, ready to go. |
random-zebra
previously approved these changes
Jun 28, 2021
random-zebra
left a comment
There was a problem hiding this comment.
ACK 5c39626da8695a46a7d71e65ce9f1f0f50103eda
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
Adaptation of btc@ebfe217b15d21656a173e5c102f826d17c6c8be4
The latest version of these two functions is inside the key_io files and not in base58.
Also remove a needless loop in DecodeBase58 to prune zeroes in the base256 output of the conversion. The number of zeroes is implied by keeping track explicitly of the length during the loop.
…base58 characters
5c39626 to
a470c34
Compare
Author
|
Rebased on master, conflicts solved. |
Fuzzbawls
approved these changes
Jul 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Decoupled from #2411 Tor's v3 addr support, built on top of #2359.
This PR finishes the address encoding cleanup, removing the
CBase58,CBitcoinSecret,CBitcoinExtKey, andCBitcoinExtPubKeyclasses, in favor of using the KeyIO::Encode/Decode functions. Furthermore, all PIVX-specific address logic is moved to key_io.{h,cpp}, leaving base58.{h,cpp} as a pure utility that implements the base58 encoding/decoding logic.Plus, includes some general utility functions for std::vector and std::string.
Adaptation of the following PRs: