Skip to content

Conversation

@furszy
Copy link

@furszy furszy commented Jun 9, 2021

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, and CBitcoinExtPubKey classes, 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:

@furszy furszy self-assigned this Jun 9, 2021
@furszy furszy added this to the 6.0.0 milestone Jun 9, 2021
@furszy furszy added the Cleanup label Jun 9, 2021
@furszy furszy force-pushed the 2021_base58_cleanup branch from cc44f9d to 5c39626 Compare June 10, 2021 03:00
@furszy
Copy link
Author

furszy commented Jun 10, 2021

Rebased after #2359 merge, ready to go.

random-zebra
random-zebra previously approved these changes Jun 28, 2021
Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 5c39626da8695a46a7d71e65ce9f1f0f50103eda

sipa and others added 12 commits June 28, 2021 15:08
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.
@furszy
Copy link
Author

furszy commented Jun 28, 2021

Rebased on master, conflicts solved.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase utACK a470c34

@furszy furszy requested a review from Fuzzbawls June 30, 2021 14:57
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK a470c34

@furszy furszy merged commit 170beab into PIVX-Project:master Jul 1, 2021
@furszy furszy deleted the 2021_base58_cleanup branch November 29, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants