Skip to content

Add ListEncodedOption#80

Merged
macladson merged 2 commits into
sigp:mainfrom
dknopik:list-encoded-option
Mar 31, 2026
Merged

Add ListEncodedOption#80
macladson merged 2 commits into
sigp:mainfrom
dknopik:list-encoded-option

Conversation

@dknopik
Copy link
Copy Markdown
Member

@dknopik dknopik commented Mar 16, 2026

Add ListEncodedOption, which represents an Option via an ssz list with one or zero items:

/// An `Option<T>` that is SSZ-encoded as a `VariableList<T, 1>`.
///
/// `None` is encoded as an empty list and `Some(value)` as a single-element list.
/// This is useful for representing optional fields in SSZ containers without
/// relying on a union type.

This is e.g. used in partial data columns: ethereum/consensus-specs#4558

@dknopik dknopik changed the title add list encoded option Add ListEncodedOption Mar 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 59.37500% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.21%. Comparing base (f3fcb7e) to head (b683bf5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/list_encoded_option.rs 59.37% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
+ Coverage   50.10%   51.21%   +1.11%     
==========================================
  Files          13       14       +1     
  Lines         461      492      +31     
==========================================
+ Hits          231      252      +21     
- Misses        230      240      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@michaelsproul michaelsproul requested a review from macladson March 30, 2026 12:00
Copy link
Copy Markdown
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@macladson macladson merged commit 8fa3081 into sigp:main Mar 31, 2026
9 checks passed
@macladson macladson mentioned this pull request Mar 31, 2026
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.

3 participants