Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
malik672 committed Oct 23, 2024
1 parent 0cf14ca commit 840daf1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/evm/fuzz/src/strategies/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl UintStrategy {
};

let (min, max) = self.bounds.unwrap_or((U256::ZERO, self.type_max()));
Ok(UintValueTree::new(start, false, min, max))
Ok(UintValueTree::new(start, false, Some(min), Some(max)))
}

fn generate_fixtures_tree(&self, runner: &mut TestRunner) -> NewTree<Self> {
Expand Down Expand Up @@ -251,7 +251,9 @@ impl UintStrategy {
}
};

Ok(UintValueTree::new(start.clamp(min, max), false, min, max))
let (min, max) = self.bounds.unwrap_or((U256::ZERO, self.type_max()));

Ok(UintValueTree::new(start.clamp(min, max), false, Some(min), Some(max)))
}

fn generate_log_uniform(&self, runner: &mut TestRunner) -> U256 {
Expand All @@ -262,6 +264,8 @@ impl UintStrategy {
let base = U256::from(1) << exp;
let mut value = base | (U256::from(mantissa) & (base - U256::from(1)));

let (min, max) = self.bounds.unwrap_or((U256::ZERO, self.type_max()));

value = value.clamp(min, max);

if value == min && max > min {
Expand Down

0 comments on commit 840daf1

Please sign in to comment.