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

chore(sdk): SealedHeader generic over header #11429

Merged
merged 8 commits into from
Oct 4, 2024
Merged

Conversation

emhane
Copy link
Member

@emhane emhane commented Oct 2, 2024

Makes SealedHeader type definition generic over header type, which is a necessary first step to use SealedHeader in Block trait methods

@emhane emhane added C-debt Refactor of code section that is hard to understand or maintain A-sdk Related to reth's use as a library labels Oct 2, 2024
@emhane
Copy link
Member Author

emhane commented Oct 2, 2024

not sure how to fix this test. necessary to get this merged in order to add the primitive traits module to the library, and import into reth-node-types. @mattsse

Copy link
Collaborator

@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.

q for @joshieDo otherwise lgtm

use serde::{Deserialize, Serialize};

/// A [`Header`] that is sealed at a precalculated hash, use [`SealedHeader::unseal()`] if you want
/// to modify header.
#[derive(Debug, Clone, PartialEq, Eq, Hash, AsRef, Deref, Serialize, Deserialize)]
#[add_arbitrary_tests(rlp)]
pub struct SealedHeader {
pub struct SealedHeader<H = Header> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that's reasonable, although for header op and eth use the same type

Copy link
Member Author

Choose a reason for hiding this comment

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

we shouldn't only limit this to op

Copy link
Collaborator

Choose a reason for hiding this comment

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

makes sense

crates/primitives-traits/src/header/sealed.rs Outdated Show resolved Hide resolved
@mattsse mattsse added this pull request to the merge queue Oct 4, 2024
Merged via the queue into main with commit 16c39d9 Oct 4, 2024
35 checks passed
@mattsse mattsse deleted the emhane/sealed-header branch October 4, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants