From 2cdde508d0413a34841acbb830d813c65f47448f Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Mon, 27 Jan 2025 19:08:56 +0200 Subject: [PATCH] feat(eth-wire): improve Capability arbitrary implementation (#14011) Co-authored-by: Matthias Seitz --- crates/net/eth-wire-types/src/capability.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/net/eth-wire-types/src/capability.rs b/crates/net/eth-wire-types/src/capability.rs index 2002a03aea..3b4ca4fc5f 100644 --- a/crates/net/eth-wire-types/src/capability.rs +++ b/crates/net/eth-wire-types/src/capability.rs @@ -90,9 +90,9 @@ impl From for Capability { #[cfg(any(test, feature = "arbitrary"))] impl<'a> arbitrary::Arbitrary<'a> for Capability { fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { - let version = u.int_in_range(0..=32)?; // TODO: What's the max? - let name = String::arbitrary(u)?; // TODO: what possible values? - Ok(Self::new(name, version)) + let version = u.int_in_range(66..=69)?; // Valid eth protocol versions are 66-69 + // Only generate valid eth protocol name for now since it's the only supported protocol + Ok(Self::new_static("eth", version)) } }