Get arbitrary check passing (2.0) (#2710)

## Issue Addressed

NA

## Proposed Changes

This is a wholesale rip-off of #2708, see that PR for more of a description.

I've made this PR since @realbigsean is offline and I can't merge his PR due to Github's frustrating `target-branch-check` bug. I also changed the branch to `unstable`, since I'm trying to minimize the diff between `merge-f2f`/`unstable`. I'll just rebase `merge-f2f` onto `unstable` after this PR merges.

When running `make lint` I noticed the following warning:

```
warning: patch for `fixed-hash` uses the features mechanism. default-features and features will not take effect because the patch dependency does not support this mechanism
```

So, I removed the `features` section from the patch.

## Additional Info

NA


Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
Paul Hauner
2021-10-14 02:58:11 +00:00
parent e2d09bb8ac
commit 18340d1fb6
25 changed files with 93 additions and 68 deletions

View File

@@ -327,7 +327,7 @@ pub fn get_active_validator_indices(validators: &[Validator], epoch: Epoch) -> V
}
#[cfg(feature = "arbitrary-fuzz")]
impl arbitrary::Arbitrary for CommitteeCache {
impl arbitrary::Arbitrary<'_> for CommitteeCache {
fn arbitrary(_u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
Ok(Self::default())
}

View File

@@ -62,7 +62,7 @@ impl ExitCache {
}
#[cfg(feature = "arbitrary-fuzz")]
impl arbitrary::Arbitrary for ExitCache {
impl arbitrary::Arbitrary<'_> for ExitCache {
fn arbitrary(_u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
Ok(Self::default())
}

View File

@@ -43,7 +43,7 @@ impl PubkeyCache {
}
#[cfg(feature = "arbitrary-fuzz")]
impl arbitrary::Arbitrary for PubkeyCache {
impl arbitrary::Arbitrary<'_> for PubkeyCache {
fn arbitrary(_u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
Ok(Self::default())
}

View File

@@ -589,7 +589,7 @@ impl OptionalTreeHashCacheInner {
}
#[cfg(feature = "arbitrary-fuzz")]
impl<T: EthSpec> arbitrary::Arbitrary for BeaconTreeHashCache<T> {
impl<T: EthSpec> arbitrary::Arbitrary<'_> for BeaconTreeHashCache<T> {
fn arbitrary(_u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
Ok(Self::default())
}

View File

@@ -20,7 +20,7 @@ pub struct PendingAttestation<T: EthSpec> {
}
#[cfg(feature = "arbitrary-fuzz")]
impl<T: EthSpec> arbitrary::Arbitrary for PendingAttestation<T> {
impl<T: EthSpec> arbitrary::Arbitrary<'_> for PendingAttestation<T> {
fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
Ok(Self {
aggregation_bits: <BitList<T::MaxValidatorsPerCommittee>>::arbitrary(u)?,