[go: up one dir, main page]

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

remove proptest specific encoding logic #6503

Merged
merged 22 commits into from
Feb 28, 2024
Prev Previous commit
Next Next commit
chore: fix cargo hack check
  • Loading branch information
Rjected committed Feb 28, 2024
commit 4d5dda7d13ccdf4a98ddb06cd226a86c03d815c0
8 changes: 3 additions & 5 deletions crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct Block {
#[cfg(any(test, feature = "arbitrary"))]
impl proptest::arbitrary::Arbitrary for Block {
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
type Strategy = proptest::prelude::BoxedStrategy<Self>;

fn arbitrary_with(_: Self::Parameters) -> Self::Strategy {
use proptest::{collection::vec, prelude::*};
Expand Down Expand Up @@ -337,7 +337,7 @@ pub struct SealedBlock {
#[cfg(any(test, feature = "arbitrary"))]
impl proptest::arbitrary::Arbitrary for SealedBlock {
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
type Strategy = proptest::prelude::BoxedStrategy<Self>;

fn arbitrary_with(_: Self::Parameters) -> Self::Strategy {
use proptest::{collection::vec, prelude::*};
Expand Down Expand Up @@ -724,12 +724,10 @@ impl<'a> arbitrary::Arbitrary<'a> for BlockBody {
}
}

use proptest::prelude::BoxedStrategy;

#[cfg(any(test, feature = "arbitrary"))]
impl proptest::arbitrary::Arbitrary for BlockBody {
type Parameters = ();
type Strategy = BoxedStrategy<Self>;
type Strategy = proptest::prelude::BoxedStrategy<Self>;

fn arbitrary_with(_: Self::Parameters) -> Self::Strategy {
use proptest::{collection::vec, prelude::*};
Expand Down
1 change: 1 addition & 0 deletions crates/primitives/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ impl proptest::arbitrary::Arbitrary for SealedHeader {
type Strategy = proptest::strategy::BoxedStrategy<SealedHeader>;
}

#[cfg(any(test, feature = "arbitrary"))]
impl<'a> arbitrary::Arbitrary<'a> for SealedHeader {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
// Directly generate values for Header and BlockHash using Unstructured
Expand Down
Loading