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

Remove Writeable impl for [u8; 4] #3132

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Nov 20, 2019

This impl of the Writeable trait feels wrong and as far as I can tell its not actively used by anything.

Note we call write_bytes() here and not write_fixed_bytes().
This will prefix the bytes themselves with a u64 to represent the size in bytes (which in this case is always a fixed 4 bytes). So we would be serializing 4 bytes as 8 bytes + 4 bytes each time.

The only place I see [u8; 4] being used is in the keychain crate for ExtendedPrivKey and Fingerprint but I do not see these using Readable/Writeable traits anywhere.

@yeastplume Do you reckon this is safe to cleanup?
Is there anywhere we may be using this?

@antiochp antiochp requested a review from yeastplume November 20, 2019 17:53
@antiochp antiochp changed the title Remove Writeable impl for [u8; 4] [DNM] Remove Writeable impl for [u8; 4] Nov 22, 2019
@antiochp antiochp changed the title [DNM] Remove Writeable impl for [u8; 4] Remove Writeable impl for [u8; 4] Jan 29, 2020
@antiochp antiochp merged commit 5e1fe44 into mimblewimble:master Jan 29, 2020
@antiochp antiochp deleted the writeable_for_u8_4 branch January 29, 2020 14:56
quentinlesceller added a commit to quentinlesceller/grin that referenced this pull request Feb 5, 2020
@antiochp antiochp mentioned this pull request Feb 24, 2020
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.

1 participant