Skip to content

Commit

Permalink
auction: ensure that step_count > 1 in AH
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Apr 23, 2024
1 parent a1ce6d6 commit 5ad6223
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ impl ActionHandler for ActionDutchAuctionSchedule {
end_height
);

// Check that the step count is positive.
// Check that the step count is at least 2. This is important
// because DA price interpolation assumes that `step_count-1` is positive.
ensure!(
step_count > 0,
"step count MUST be greater than zero (got: {step_count})"
step_count >= 2,
"step count MUST be at least two (got: {step_count})"
);

// Check that the step count is less than 255.
Expand Down

0 comments on commit 5ad6223

Please sign in to comment.