Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix various warnings in noir code #8258

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mod test {
global ADDRESS_NOTE_BYTES_LEN = 32 * 3 + 64;

impl NoteInterface<ADDRESS_NOTE_LEN, ADDRESS_NOTE_BYTES_LEN> for AddressNote {
fn compute_note_hiding_point(self) -> Point {
fn compute_note_hiding_point(_self: Self) -> Point {
crate::generators::Ga1
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ struct PrivateKernelResetCircuitPrivateInputs<let NH_RR_PENDING: u32, let NH_RR_
}

impl<
let NH_RR_PENDING: u32,
let NH_RR_SETTLED: u32,
let NLL_RR_PENDING: u32,
let NH_RR_PENDING: u32,
let NH_RR_SETTLED: u32,
let NLL_RR_PENDING: u32,
let NLL_RR_SETTLED: u32,
let KEY_VALIDATION_REQUESTS: u32,
let TRANSIENT_DATA_AMOUNT: u32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ unconstrained fn get_height(input: u32, start: u8) -> u8 {
// Since we cannot isolate branches, it doesn't cost fewer gates than using
// MerkleTree on the full array of elements N, but is slightly cheaper on-chain
// and cleaner elsewhere.
impl<let N: u32> VariableMerkleTree {
impl VariableMerkleTree {
// Example - tx_0 with 3 msgs | tx_1 with 2 msgs creates:
//
//
// tx0oh tx1oh
// / \ / \
// / \ / \
// msg01 msg23 msg3 msg4
// / \ / \
// msg0 msg1 msg2 0
// / \ / \
// msg0 msg1 msg2 0
// | tx_0 | | tx_1 |
//
pub fn new_sha(leaves: [Field; N], num_non_empty_leaves: u32) -> Self {
pub fn new_sha<let N: u32>(leaves: [Field; N], num_non_empty_leaves: u32) -> Self {
// Find size of tree required
let height = get_height(num_non_empty_leaves, 0);
let next_power_2 = 2 << height;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{abis::side_effect::{Positioned, Ordered}, traits::Empty, utils::arra

/*
The sorted_array here needs to be sorted based on the `position` field of the container,
*and* a secondary sort based on the `counter` field of the container.
*and* a secondary sort based on the `counter` field of the container.

For example, the storage slot in the case of public data update requests.
The run_lengths array should contain the length of each run of the sorted_array.
Expand All @@ -25,13 +25,13 @@ use crate::{abis::side_effect::{Positioned, Ordered}, traits::Empty, utils::arra
then the deduped_array should be:
[ (1,2,4), (2,3,3), (3,6,6), (4,8,9), (5,9,7), (0,0,0), ... padding with zeros ]
*/
pub fn assert_deduped_array<T, let N: u32, Env>(
pub fn assert_deduped_array<T, let N: u32>(
sorted_array: [T; N],
deduped_array: [T; N],
run_lengths: [u32; N]
) where T: Positioned + Ordered + Empty + Eq {
let num_non_empty_items = array_length(sorted_array);
let deduped_len = validate_array(deduped_array); // This makes sure that the array is padded with empty items.
let deduped_len = validate_array(deduped_array); // This makes sure that the array is padded with empty items.

// container at the start of the current run
let mut start_run_container = sorted_array[0];
Expand Down
Loading