Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Mar 22, 2024
1 parent c65b8e3 commit f1419ee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
8 changes: 0 additions & 8 deletions src/data_structures/mmr/peaks.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,4 @@ impl PeaksImpl of PeaksTrait {
let computed_root = compute_root(last_pos.into(), self);
computed_root == root
}

// @notice Checks if the peaks contain a peak
// @param peak The peak to check inclusion
// @return True if the peaks contain the peak
#[inline(always)]
fn contains_peak(self: Peaks, peak: felt252) -> bool {
span_contains(self, peak)
}
}
18 changes: 0 additions & 18 deletions src/data_structures/mmr/tests/test_peaks.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,3 @@ fn test_valid() {

assert(peaks.span().valid(last_pos_u32, root), 'Valid');
}

#[test]
#[available_gas(99999999)]
fn test_containts_peak() {
let peak0 = PoseidonHasher::hash_double(245, 287388);
let peak1 = PoseidonHasher::hash_double(2340, 827394299);
let peak2 = PoseidonHasher::hash_double(923048, 23984294798);

let peaks_arr = array![peak0, peak1, peak2];
let peaks = peaks_arr.span();

assert(peaks.contains_peak(peak0), 'Contains peak 0');
assert(peaks.contains_peak(peak1), 'Contains peak 1');
assert(peaks.contains_peak(peak2), 'Contains peak 2');

assert(!peaks.contains_peak(0), 'Does not contain 0');
assert(!peaks.contains_peak(1), 'Does not contain 1');
}

0 comments on commit f1419ee

Please sign in to comment.