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

Merged
merged 12 commits into from
Nov 23, 2024
Merged

Conversation

zitup
Copy link
Contributor

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

Copy link
Contributor Author

@zitup zitup Nov 20, 2024

Choose a reason for hiding this comment

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

Yeah, I have updated the fmt setting of rust-analyzer :)

@@ -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))
    }
}

@zitup zitup requested a review from klkvr as a code owner November 20, 2024 05:05
@zitup
Copy link
Contributor Author

zitup commented Nov 21, 2024

Some checks were not successful, should I do something?

There is an import order error in primitives-traits/src/receipt.rs,
primitives-traits/src/header/sealed.rs has an unused “MaybeArbitrary” error that I don't know why, optimism/primitives/src/tx_type.rs has an not found “arbitrary” error.

@emhane
Copy link
Member

emhane commented Nov 21, 2024

Some checks were not successful, should I do something?

There is an import order error in primitives-traits/src/receipt.rs, primitives-traits/src/header/sealed.rs has an unused “MaybeArbitrary” error that I don't know why, optimism/primitives/src/tx_type.rs has an not found “arbitrary” error.

I will check it out

@emhane emhane requested a review from gakonst as a code owner November 21, 2024 15:20
@emhane emhane added this pull request to the merge queue Nov 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 21, 2024
@emhane emhane added this pull request to the merge queue Nov 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 21, 2024
@emhane emhane added this pull request to the merge queue Nov 21, 2024
@emhane emhane removed this pull request from the merge queue due to a manual request Nov 21, 2024
@emhane emhane added this pull request to the merge queue Nov 23, 2024
Merged via the queue into paradigmxyz:main with commit ebb4fc2 Nov 23, 2024
37 of 41 checks passed
mattsse added a commit that referenced this pull request Nov 23, 2024
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