Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Jun 17, 2024
1 parent cb117d6 commit 979215c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/evm/fuzz/src/invariant/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ impl FuzzRunIdentifiedContracts {
}
}

#[derive(Debug)]
/// A collection of contracts targeted for invariant testing.
#[derive(Clone, Debug, Default)]
pub struct TargetedContracts {
/// The inner map of targeted contracts.
pub inner: BTreeMap<Address, TargetedContract>,
}

impl TargetedContracts {
/// Returns a new `TargetedContracts` instance.
pub fn new() -> Self {
Self { inner: BTreeMap::new() }
Self::default()
}

/// Returns fuzzed contract abi and fuzzed function from address and provided calldata.
Expand All @@ -115,7 +117,7 @@ impl TargetedContracts {

/// Returns flatten target contract address and functions to be fuzzed.
/// Includes contract targeted functions if specified, else all mutable contract functions.
pub fn fuzzed_functions<'a>(&'a self) -> impl Iterator<Item = (&'a Address, &'a Function)> {
pub fn fuzzed_functions(&self) -> impl Iterator<Item = (&Address, &Function)> {
self.inner
.iter()
.filter(|(_, c)| !c.abi.functions.is_empty())
Expand All @@ -137,7 +139,8 @@ impl std::ops::DerefMut for TargetedContracts {
}
}

#[derive(Debug)]
/// A contract targeted for invariant testing.
#[derive(Clone, Debug)]
pub struct TargetedContract {
/// The contract identifier. This is only used in error messages.
pub identifier: String,
Expand Down

0 comments on commit 979215c

Please sign in to comment.