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

fix(primitives): return correct fixed length in ssz::Encode #451

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

blombern
Copy link
Contributor

@blombern blombern commented Dec 13, 2023

Motivation

Fixes #448

Fixed length objects should return the number of bytes this object occupies in the fixed-length portion of the SSZ bytes. Without an implementation it defaults to BYTES_PER_LENGTH_OFFSET which is wrong for fixed size.

Solution

Add trait method implementation that returns correct length.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

pending @DaniPopes

@DaniPopes DaniPopes merged commit f1176b3 into alloy-rs:main Dec 13, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect ssz::Encode implementation
3 participants