Skip to content

Commit

Permalink
audit: index verification (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 authored Nov 16, 2023
1 parent 7224165 commit 3138786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compute_engines/summary_stats/summary_stats.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ mod SummaryStats {
num_samples: u64,
aggregation_mode: AggregationMode,
) -> (u128, u32) {
assert(start_tick < end_tick, 'start_tick must be < end_tick');
let oracle_address = self.oracle_address.read();

assert(num_samples > 0, 'num_samples must be > 0');
Expand All @@ -135,6 +134,7 @@ mod SummaryStats {
.get_last_checkpoint_before(data_type, end_tick, aggregation_mode);
end_index = _end_idx;
}
assert(start_index < end_index, 'start_tick must be < end_tick');
assert(start_index != latest_checkpoint_index, 'Not enough data');
let mut tick_arr = ArrayTrait::<TickElem>::new();
let skip_frequency = calculate_skip_frequency(end_index - start_index, num_samples);
Expand Down

0 comments on commit 3138786

Please sign in to comment.