chore: remove proptest arbitrary from codec derive and tests (#8968)

This commit is contained in:
Dan Cline
2024-06-20 19:02:07 -04:00
committed by GitHub
parent 6b2c3af8b9
commit 8492ab3d52
41 changed files with 205 additions and 312 deletions

View File

@ -39,8 +39,6 @@ snap = "1.0.5"
# arbitrary utils
arbitrary = { workspace = true, features = ["derive"], optional = true }
proptest = { workspace = true, optional = true }
proptest-derive = { workspace = true, optional = true }
[dev-dependencies]
reth-net-common.workspace = true
@ -58,6 +56,7 @@ secp256k1 = { workspace = true, features = [
arbitrary = { workspace = true, features = ["derive"] }
proptest.workspace = true
proptest-arbitrary-interop.workspace = true
proptest-derive.workspace = true
async-stream.workspace = true
@ -66,8 +65,6 @@ default = ["serde"]
arbitrary = [
"reth-primitives/arbitrary",
"dep:arbitrary",
"dep:proptest",
"dep:proptest-derive",
]
optimism = ["reth-primitives/optimism"]
serde = ["dep:serde"]

View File

@ -129,22 +129,6 @@ impl<'a> arbitrary::Arbitrary<'a> for Capability {
}
}
#[cfg(any(test, feature = "arbitrary"))]
impl proptest::arbitrary::Arbitrary for Capability {
type Parameters = proptest::arbitrary::ParamsFor<String>;
fn arbitrary_with(args: Self::Parameters) -> Self::Strategy {
use proptest::strategy::Strategy;
proptest::arbitrary::any_with::<String>(args) // TODO: what possible values?
.prop_flat_map(move |name| {
proptest::arbitrary::any_with::<usize>(()) // TODO: What's the max?
.prop_map(move |version| Self::new(name.clone(), version))
})
.boxed()
}
type Strategy = proptest::strategy::BoxedStrategy<Self>;
}
/// Represents all capabilities of a node.
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Capabilities {