From 1340d5a3755bdb5f6c226a1e78da9ef65a45499d Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Tue, 13 May 2025 14:53:20 -0300 Subject: [PATCH 1/2] Remove unused generic --- .../noir-protocol-circuits/crates/types/src/utils/arrays.nr | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr index e1991cdf89ee..0dc3d0a5ba4f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr @@ -288,11 +288,7 @@ where // Helper function to check if an array is padded with a given value from a given index. // Different to padded_array_length in that it allows the elements before the given index to be the same as the padded value. -pub fn array_padded_with( - array: [T; N], - from_index: u32, - padded_with: T, -) -> bool +pub fn array_padded_with(array: [T; N], from_index: u32, padded_with: T) -> bool where T: Eq, { From 8f160135b9517d378f1873ada448729ddc8af55a Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Tue, 13 May 2025 14:53:24 -0300 Subject: [PATCH 2/2] Specificy some generics that cannot be deduced --- .../shared_mutable/shared_mutable_values/test.nr | 2 +- .../crates/types/src/shared_mutable/with_hash.nr | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/shared_mutable_values/test.nr b/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/shared_mutable_values/test.nr index 07c63f041057..4f1673f61e20 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/shared_mutable_values/test.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/shared_mutable_values/test.nr @@ -72,7 +72,7 @@ unconstrained fn packed_shared_mutable_values_match_typescript() { let pre_value = MockStruct { a: 1, b: 2 }; let post_value = MockStruct { a: 3, b: 4 }; - let sdc = ScheduledDelayChange::new(Option::some(1), Option::some(50), 2); + let sdc = ScheduledDelayChange::<0>::new(Option::some(1), Option::some(50), 2); let svc = ScheduledValueChange::new(pre_value, post_value, 50); let smv = SharedMutableValues::new(svc, sdc); diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/with_hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/with_hash.nr index 678c1d360b5f..0fabedf1fc73 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/with_hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/with_hash.nr @@ -133,8 +133,8 @@ mod tests { next_index: 0, }; - let with_hash_hint = SharedMutableValues::new( - ScheduledValueChange::::empty(), + let with_hash_hint = SharedMutableValues::::new( + ScheduledValueChange::empty(), ScheduledDelayChange::empty(), ); @@ -216,8 +216,8 @@ mod tests { BlockHeader::empty(), 27, AztecAddress::from_field(42), - SharedMutableValues::new( - ScheduledValueChange::::empty(), + SharedMutableValues::::new( + ScheduledValueChange::empty(), ScheduledDelayChange::empty(), ), MembershipWitness { leaf_index: 80, sibling_path: std::mem::zeroed() }, @@ -252,8 +252,8 @@ mod tests { historical_header, with_hash_storage_slot, contract_address, - SharedMutableValues::new( - ScheduledValueChange::::empty(), + SharedMutableValues::::new( + ScheduledValueChange::empty(), ScheduledDelayChange::empty(), ), witness, @@ -286,7 +286,7 @@ mod tests { next_index: 0, }; // Expected to be empty, it's not - let value_hint = SharedMutableValues::new( + let value_hint = SharedMutableValues::::new( ScheduledValueChange::new( ContractClassId::from_field(0), ContractClassId::from_field(96),