Skip to content
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

Refactor address crate #376

Merged
merged 8 commits into from
Apr 28, 2020
Merged

Refactor address crate #376

merged 8 commits into from
Apr 28, 2020

Conversation

austinabell
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Refactors address to remove heap allocation and allows easier access to the underlying data
    • Can match on <Address>.protocol() to access the actual data format of the address, instead of retrieving the encoded bytes and do own validation with the protocol and decoding in some cases.
    • Mainly needed to retrieve the BLS public key from that address type when needed, instead of having to validate and copy to a buffer
    • Removes possible errors from instantiating anything except BLS Address type (This can be removed as well, but requires a [u8; 48] to be passed in instead of a slice, and this is not very ergonomic to use)
    • Allows addresses to implement Copy now

Interface should just be an extension of what exists now, except for the constructors, which are breaking changes

Reference issue to close (if applicable)

Closes

Other information and links

Copy link
Contributor

@dutterbutter dutterbutter left a comment

Choose a reason for hiding this comment

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

🔥🔥🔥

@austinabell austinabell merged commit 7e8124d into master Apr 28, 2020
@austinabell austinabell deleted the austin/addressref branch April 28, 2020 17:06
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.

None yet

3 participants