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): Add MaybeArbitrary as super trait #12661

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zitup
Copy link

@zitup zitup commented Nov 19, 2024

Closes #12582.

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

nice!

@@ -427,7 +427,7 @@ impl SealedBlock {
return Err(GotExpected {
got: calculated_root,
expected: self.header.transactions_root,
})
});
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
});
})

pls revert unrelated formatting change (use cargo +nightly fmt instead of cargo fmt)

@@ -467,6 +467,7 @@ impl<H, B> reth_primitives_traits::Block for SealedBlock<H, B>
where
H: reth_primitives_traits::BlockHeader + 'static,
B: reth_primitives_traits::BlockBody + 'static,
SealedHeader<H>: MaybeArbitrary,
Copy link
Member

Choose a reason for hiding this comment

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

instead of this bound here, relax the arbitrary impl for SealedHeader

#[cfg(any(test, feature = "arbitrary"))]
impl<'a, H> arbitrary::Arbitrary<'a> for SealedHeader<H> where H: for<'a> arbitrary::Arbitrary<'a> {
    fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
        let header = Header::arbitrary(u)?;

        Ok(Self::seal(header))
    }
}

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.

MaybeArbitrary super trait
2 participants