Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
acb958c
[1 changes] fix: homogeneous input points for EC ADD (https://github.…
Oct 9, 2024
8ebe3c2
chore: apply sync fixes
Oct 9, 2024
9afc69d
[1 changes] fix: visibility for impl methods (https://github.com/noir…
Oct 10, 2024
7c635e6
chore: apply sync fixes
Oct 10, 2024
caab224
fix: visibility for impl methods (https://github.com/noir-lang/noir/p…
Oct 10, 2024
485da30
[1 changes] feat(test): Fuzz poseidon hases against an external libra…
Oct 10, 2024
0abe72d
chore: apply sync fixes
Oct 10, 2024
3a60573
feat(test): Fuzz poseidon hases against an external library (https://…
Oct 10, 2024
04e12a9
Merge branch 'master' into sync-noir
TomAFrench Oct 10, 2024
9170c60
.
TomAFrench Oct 10, 2024
055a3d2
.
TomAFrench Oct 10, 2024
a649a86
.
TomAFrench Oct 10, 2024
b2c97e8
.
TomAFrench Oct 10, 2024
bb54ecd
.
TomAFrench Oct 11, 2024
0cfe965
.
TomAFrench Oct 11, 2024
9c99120
.
TomAFrench Oct 11, 2024
a97fb97
.
TomAFrench Oct 11, 2024
c5a2b28
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
267f7c0
[1 changes] feat: slightly improve "unexpected token" error message (…
Oct 11, 2024
f451abd
chore: apply sync fixes
Oct 11, 2024
043e812
feat: slightly improve "unexpected token" error message (https://gith…
Oct 11, 2024
24d9d6f
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
ae46950
.
TomAFrench Oct 11, 2024
87f7137
.
TomAFrench Oct 11, 2024
2980169
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
c5e9d64
.
TomAFrench Oct 11, 2024
630ec07
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
acc4438
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
2ecf7ff
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
444777b
Update tail_output_composer.nr
TomAFrench Oct 11, 2024
a27c5d4
[1 changes] chore: regression test for #5462 (https://github.com/noir…
Oct 12, 2024
23b90bb
chore: apply sync fixes
Oct 12, 2024
1199fb0
chore: regression test for #5462 (https://github.com/noir-lang/noir/p…
Oct 12, 2024
2179898
[1 changes] chore: regression test for #5462 (https://github.com/noir…
Oct 13, 2024
ff5a45f
chore: apply sync fixes
Oct 13, 2024
fdedf32
chore: regression test for #5462 (https://github.com/noir-lang/noir/p…
Oct 13, 2024
a5083ec
[1 changes] chore: regression test for #5462 (https://github.com/noir…
Oct 14, 2024
44dad1f
chore: apply sync fixes
Oct 14, 2024
0f84874
chore: regression test for #5462 (https://github.com/noir-lang/noir/p…
Oct 14, 2024
023c21a
Merge branch 'master' into sync-noir
TomAFrench Oct 14, 2024
e385aa9
.
TomAFrench Oct 14, 2024
0e70c14
.
TomAFrench Oct 14, 2024
4eee91e
.
TomAFrench Oct 14, 2024
ffe0858
Merge branch 'master' into sync-noir
TomAFrench Oct 14, 2024
4088359
.
TomAFrench Oct 14, 2024
4075dcf
.
TomAFrench Oct 14, 2024
8cd1c1e
.
TomAFrench Oct 14, 2024
8f8e97a
.
TomAFrench Oct 14, 2024
a994182
.
TomAFrench Oct 14, 2024
fcf9541
chore: fix tags
TomAFrench Oct 14, 2024
28fbecd
.
TomAFrench Oct 14, 2024
1c6f06d
.
TomAFrench Oct 14, 2024
ffe00a6
.
TomAFrench Oct 14, 2024
58c05bb
.
TomAFrench Oct 14, 2024
87d5182
.
TomAFrench Oct 14, 2024
8ae9e95
.
TomAFrench Oct 14, 2024
3e68942
.
TomAFrench Oct 14, 2024
928d7a9
.
TomAFrench Oct 14, 2024
609cc3b
.
TomAFrench Oct 14, 2024
3c0e9f1
.
TomAFrench Oct 14, 2024
2ab81c6
.
TomAFrench Oct 14, 2024
830a200
Merge branch 'master' into sync-noir
TomAFrench Oct 14, 2024
d23ca53
.
TomAFrench Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c4273a0c8f8b751a3dbe097e070e4e7b2c8ec438
8d8ea8963c5e4e23bd387aa729e09d3a9553a698
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/authwit/src/auth_witness.nr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ unconstrained fn get_auth_witness_oracle<let N: u32>(_message_hash: Field) -> [F
* @param message_hash The hash of the message for which the `auth_witness` is to be fetched.
* @return The `auth_witness` for the given `message_hash` as Field array.
*/
unconstrained pub fn get_auth_witness<let N: u32>(message_hash: Field) -> [Field; N] {
pub unconstrained fn get_auth_witness<let N: u32>(message_hash: Field) -> [Field; N] {
get_auth_witness_oracle(message_hash)
}
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/context/public_context.nr
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ unconstrained fn call_static<let RET_SIZE: u32>(
call_static_opcode(gas, address, args, function_selector)
}

unconstrained pub fn calldata_copy<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {
pub unconstrained fn calldata_copy<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {
calldata_copy_opcode(cdoffset, copy_size)
}

Expand Down
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/aztec/src/keys/getters/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use crate::{

mod test;

unconstrained pub fn get_nsk_app(npk_m_hash: Field) -> Field {
pub unconstrained fn get_nsk_app(npk_m_hash: Field) -> Field {
get_key_validation_request(npk_m_hash, NULLIFIER_INDEX).sk_app
}

// A helper function that gets app-siloed outgoing viewing key for a given `ovpk_m_hash`. This function is used
// in unconstrained contexts only - when computing unconstrained note logs. The safe alternative is `request_ovsk_app`
// function defined on `PrivateContext`.
unconstrained pub fn get_ovsk_app(ovpk_m_hash: Field) -> Field {
pub unconstrained fn get_ovsk_app(ovpk_m_hash: Field) -> Field {
get_key_validation_request(ovpk_m_hash, OUTGOING_INDEX).sk_app
}

Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/keys/getters/test.nr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ unconstrained fn setup() -> TestAccount {
account
}

#[test(should_fail_with="Invalid public keys hint for address")]
#[test(should_fail_with = "Invalid public keys hint for address")]
unconstrained fn test_get_public_keys_unknown() {
let account = setup();

Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ unconstrained fn get_notes_internal<Note, let N: u32, PREPROCESSOR_ARGS, FILTER_
apply_preprocessor(opt_notes, options.preprocessor, options.preprocessor_args)
}

unconstrained pub fn view_notes<Note, let N: u32>(
pub unconstrained fn view_notes<Note, let N: u32>(
storage_slot: Field,
options: NoteViewerOptions<Note, N>
) -> BoundedVec<Note, MAX_NOTES_PER_PAGE> where Note: NoteInterface<N> {
Expand Down
12 changes: 6 additions & 6 deletions noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ unconstrained fn can_return_zero_notes() {
assert_eq(returned.len(), 0);
}

#[test(should_fail_with="Got more notes than limit.")]
#[test(should_fail_with = "Got more notes than limit.")]
unconstrained fn rejects_mote_notes_than_limit() {
let mut env = setup();
let mut context = env.private();
Expand Down Expand Up @@ -155,7 +155,7 @@ unconstrained fn applies_filter_before_constraining() {
assert_eq(context.note_hash_read_requests.len(), 1);
}

#[test(should_fail_with="Mismatch note header contract address.")]
#[test(should_fail_with = "Mismatch note header contract address.")]
unconstrained fn rejects_mismatched_address() {
let mut env = setup();
let mut context = env.private();
Expand All @@ -169,7 +169,7 @@ unconstrained fn rejects_mismatched_address() {
let _ = constrain_get_notes_internal(&mut context, storage_slot, opt_notes, options);
}

#[test(should_fail_with="Mismatch note header storage slot.")]
#[test(should_fail_with = "Mismatch note header storage slot.")]
unconstrained fn rejects_mismatched_storage_slot() {
let mut env = setup();
let mut context = env.private();
Expand All @@ -183,7 +183,7 @@ unconstrained fn rejects_mismatched_storage_slot() {
let _ = constrain_get_notes_internal(&mut context, storage_slot, opt_notes, options);
}

#[test(should_fail_with="Mismatch return note field.")]
#[test(should_fail_with = "Mismatch return note field.")]
unconstrained fn rejects_mismatched_selector() {
let mut env = setup();
let mut context = env.private();
Expand All @@ -204,7 +204,7 @@ unconstrained fn rejects_mismatched_selector() {
let _ = constrain_get_notes_internal(&mut context, storage_slot, opt_notes, options);
}

#[test(should_fail_with="Return notes not sorted in descending order.")]
#[test(should_fail_with = "Return notes not sorted in descending order.")]
unconstrained fn rejects_mismatched_desc_sort_order() {
let mut env = setup();
let mut context = env.private();
Expand All @@ -222,7 +222,7 @@ unconstrained fn rejects_mismatched_desc_sort_order() {
let _ = constrain_get_notes_internal(&mut context, storage_slot, opt_notes, options);
}

#[test(should_fail_with="Return notes not sorted in ascending order.")]
#[test(should_fail_with = "Return notes not sorted in ascending order.")]
unconstrained fn rejects_mismatched_asc_sort_order() {
let mut env = setup();
let mut context = env.private();
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/note/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn compute_note_hash_for_nullify<Note, let N: u32>(note: Note) -> Field wher
compute_note_hash_for_nullify_internal(note, note_hash_for_read_request)
}

unconstrained pub fn compute_note_hash_and_optionally_a_nullifier<T, let N: u32, let S: u32>(
pub unconstrained fn compute_note_hash_and_optionally_a_nullifier<T, let N: u32, let S: u32>(
deserialize_content: fn([Field; N]) -> T,
note_header: NoteHeader,
compute_nullifier: bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unconstrained fn call_private_function_oracle(
_is_delegate_call: bool
) -> [Field; 2] {}

unconstrained pub fn call_private_function_internal(
pub unconstrained fn call_private_function_internal(
contract_address: AztecAddress,
function_selector: FunctionSelector,
args_hash: Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unconstrained fn enqueue_public_function_call_oracle(
_is_delegate_call: bool
) -> Field {}

unconstrained pub fn enqueue_public_function_call_internal(
pub unconstrained fn enqueue_public_function_call_internal(
contract_address: AztecAddress,
function_selector: FunctionSelector,
args_hash: Field,
Expand Down Expand Up @@ -38,7 +38,7 @@ unconstrained fn set_public_teardown_function_call_oracle(
_is_delegate_call: bool
) -> Field {}

unconstrained pub fn set_public_teardown_function_call_internal(
pub unconstrained fn set_public_teardown_function_call_internal(
contract_address: AztecAddress,
function_selector: FunctionSelector,
args_hash: Field,
Expand All @@ -62,7 +62,7 @@ pub fn notify_set_min_revertible_side_effect_counter(counter: u32) {
};
}

unconstrained pub fn notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter: u32) {
pub unconstrained fn notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter: u32) {
notify_set_min_revertible_side_effect_counter_oracle(counter);
}

Expand Down
8 changes: 4 additions & 4 deletions noir-projects/aztec-nr/aztec/src/oracle/execution.nr
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ unconstrained fn get_chain_id_oracle() -> Field {}
#[oracle(getVersion)]
unconstrained fn get_version_oracle() -> Field {}

unconstrained pub fn get_contract_address() -> AztecAddress {
pub unconstrained fn get_contract_address() -> AztecAddress {
get_contract_address_oracle()
}

unconstrained pub fn get_block_number() -> u32 {
pub unconstrained fn get_block_number() -> u32 {
get_block_number_oracle()
}

unconstrained pub fn get_chain_id() -> Field {
pub unconstrained fn get_chain_id() -> Field {
get_chain_id_oracle()
}

unconstrained pub fn get_version() -> Field {
pub unconstrained fn get_version() -> Field {
get_version_oracle()
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unconstrained fn get_contract_instance_internal(address: AztecAddress) -> [Field
get_contract_instance_oracle(address)
}

unconstrained pub fn get_contract_instance_internal_avm(address: AztecAddress) -> [Field; CONTRACT_INSTANCE_LENGTH + 1] {
pub unconstrained fn get_contract_instance_internal_avm(address: AztecAddress) -> [Field; CONTRACT_INSTANCE_LENGTH + 1] {
get_contract_instance_oracle_avm(address)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use dep::protocol_types::{address::AztecAddress, constants::L1_TO_L2_MSG_TREE_HE

/// Returns the leaf index and sibling path of an entry in the L1 to L2 messaging tree, which can then be used to prove
/// its existence.
unconstrained pub fn get_l1_to_l2_membership_witness(
pub unconstrained fn get_l1_to_l2_membership_witness(
contract_address: AztecAddress,
message_hash: Field,
secret: Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ unconstrained fn get_membership_witness_oracle<let M: u32>(
_leaf_value: Field
) -> [Field; M] {}

unconstrained pub fn get_membership_witness<let N: u32, let M: u32>(
pub unconstrained fn get_membership_witness<let N: u32, let M: u32>(
block_number: u32,
tree_id: Field,
leaf_value: Field
Expand All @@ -33,7 +33,7 @@ unconstrained pub fn get_membership_witness<let N: u32, let M: u32>(

// Note: get_nullifier_membership_witness function is implemented in get_nullifier_membership_witness.nr

unconstrained pub fn get_note_hash_membership_witness(
pub unconstrained fn get_note_hash_membership_witness(
block_number: u32,
leaf_value: Field
) -> MembershipWitness<NOTE_HASH_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT + 1> {
Expand All @@ -43,7 +43,7 @@ unconstrained pub fn get_note_hash_membership_witness(
// There is no `get_public_data_membership_witness` function because it doesn't make sense to be getting a membership
// witness for a value in the public data tree.

unconstrained pub fn get_archive_membership_witness(
pub unconstrained fn get_archive_membership_witness(
block_number: u32,
leaf_value: Field
) -> MembershipWitness<ARCHIVE_HEIGHT, ARCHIVE_HEIGHT + 1> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ unconstrained fn get_low_nullifier_membership_witness_oracle(

// Nullifier here refers to the nullifier we are looking to get non-inclusion proof for (by proving that a lower
// nullifier's next_value is bigger than the nullifier)
unconstrained pub fn get_low_nullifier_membership_witness(block_number: u32, nullifier: Field) -> NullifierMembershipWitness {
pub unconstrained fn get_low_nullifier_membership_witness(block_number: u32, nullifier: Field) -> NullifierMembershipWitness {
let fields = get_low_nullifier_membership_witness_oracle(block_number, nullifier);
NullifierMembershipWitness::deserialize(fields)
}
Expand All @@ -48,7 +48,7 @@ unconstrained fn get_nullifier_membership_witness_oracle(

// Nullifier here refers to the nullifier we are looking to get non-inclusion proof for (by proving that a lower
// nullifier's next_value is bigger than the nullifier)
unconstrained pub fn get_nullifier_membership_witness(block_number: u32, nullifier: Field) -> NullifierMembershipWitness {
pub unconstrained fn get_nullifier_membership_witness(block_number: u32, nullifier: Field) -> NullifierMembershipWitness {
let fields = get_nullifier_membership_witness_oracle(block_number, nullifier);
NullifierMembershipWitness::deserialize(fields)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ unconstrained fn get_public_data_witness_oracle(
_public_data_tree_index: Field
) -> [Field; PUBLIC_DATA_WITNESS] {}

unconstrained pub fn get_public_data_witness(
pub unconstrained fn get_public_data_witness(
block_number: u32,
public_data_tree_index: Field
) -> PublicDataWitness {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ unconstrained fn get_sibling_path_oracle<let N: u32>(
_leaf_index: Field
) -> [Field; N] {}

unconstrained pub fn get_sibling_path<let N: u32>(block_number: u32, tree_id: Field, leaf_index: Field) -> [Field; N] {
pub unconstrained fn get_sibling_path<let N: u32>(block_number: u32, tree_id: Field, leaf_index: Field) -> [Field; N] {
let value: [Field; N] = get_sibling_path_oracle(block_number, tree_id, leaf_index);
value
}
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/oracle/header.nr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::test::helpers::test_environment::TestEnvironment;
#[oracle(getHeader)]
unconstrained fn get_header_at_oracle(_block_number: u32) -> [Field; HEADER_LENGTH] {}

unconstrained pub fn get_header_at_internal(block_number: u32) -> Header {
pub unconstrained fn get_header_at_internal(block_number: u32) -> Header {
let header = get_header_at_oracle(block_number);
Header::deserialize(header)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unconstrained fn get_key_validation_request_internal(
KeyValidationRequest::deserialize(result)
}

unconstrained pub fn get_key_validation_request(
pub unconstrained fn get_key_validation_request(
pk_m_hash: Field,
key_index: Field
) -> KeyValidationRequest {
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/oracle/keys.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use dep::protocol_types::{address::{AztecAddress, PartialAddress}, point::Point}
#[oracle(getPublicKeysAndPartialAddress)]
unconstrained fn get_public_keys_and_partial_address_oracle(_address: AztecAddress) -> [Field; 13] {}

unconstrained pub fn get_public_keys_and_partial_address(address: AztecAddress) -> (PublicKeys, PartialAddress) {
pub unconstrained fn get_public_keys_and_partial_address(address: AztecAddress) -> (PublicKeys, PartialAddress) {
let result = get_public_keys_and_partial_address_oracle(address);

let keys = PublicKeys {
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/oracle/logs.nr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ unconstrained fn emit_unencrypted_log_private_oracle_wrapper<T>(contract_address

/// Temporary substitute for `emit_unencrypted_log_private` that is used for handling contract class registration. This
/// variant returns the log hash, which would be too large to compute inside a circuit.
unconstrained pub fn emit_contract_class_unencrypted_log_private<let N: u32>(
pub unconstrained fn emit_contract_class_unencrypted_log_private<let N: u32>(
contract_address: AztecAddress,
message: [Field; N],
counter: u32
Expand Down
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/aztec/src/oracle/notes.nr
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ unconstrained fn get_notes_oracle_wrapper<let N: u32, let S: u32>(
)
}

unconstrained pub fn get_notes<Note, let N: u32, let M: u32, let S: u32, let NS: u32>(
pub unconstrained fn get_notes<Note, let N: u32, let M: u32, let S: u32, let NS: u32>(
storage_slot: Field,
num_selects: u8,
select_by_indexes: [u8; M],
Expand Down Expand Up @@ -175,7 +175,7 @@ unconstrained pub fn get_notes<Note, let N: u32, let M: u32, let S: u32, let NS:
/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before the
/// current transaction is included in a block. While this might seem of little use at first, certain design patterns
/// benefit from this abstraction (see e.g. `PrivateMutable`).
unconstrained pub fn check_nullifier_exists(inner_nullifier: Field) -> bool {
pub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {
check_nullifier_exists_oracle(inner_nullifier) == 1
}

Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/oracle/random.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// truly random: we assume that the oracle is cooperating and returning random values.
/// In some applications this behavior might not be acceptable and other techniques might be more suitable, such as
/// producing pseudo-random values by hashing values outside of user control (like block hashes) or secrets.
unconstrained pub fn random() -> Field {
pub unconstrained fn random() -> Field {
rand_oracle()
}

Expand Down
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/aztec/src/oracle/returns.nr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ pub fn pack_returns(returns: [Field]) {
};
}

unconstrained pub fn pack_returns_oracle_wrapper(returns: [Field]) {
pub unconstrained fn pack_returns_oracle_wrapper(returns: [Field]) {
let _ = pack_returns_oracle(returns);
}

unconstrained pub fn unpack_returns<let N: u32>(return_hash: Field) -> [Field; N] {
pub unconstrained fn unpack_returns<let N: u32>(return_hash: Field) -> [Field; N] {
unpack_returns_oracle(return_hash)
}

Expand Down
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/aztec/src/oracle/storage.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use dep::protocol_types::{address::AztecAddress, traits::Deserialize};
#[oracle(storageRead)]
unconstrained fn storage_read_oracle<let N: u32>(address: Field, storage_slot: Field, block_number: Field, length: Field) -> [Field; N] {}

unconstrained pub fn raw_storage_read<let N: u32>(
pub unconstrained fn raw_storage_read<let N: u32>(
address: AztecAddress,
storage_slot: Field,
block_number: u32
Expand All @@ -16,7 +16,7 @@ unconstrained pub fn raw_storage_read<let N: u32>(
)
}

unconstrained pub fn storage_read<T, let N: u32>(
pub unconstrained fn storage_read<T, let N: u32>(
address: AztecAddress,
storage_slot: Field,
block_number: u32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ impl<Note> PrivateImmutable<Note, &mut PrivateContext> {

impl<Note> PrivateImmutable<Note, UnconstrainedContext> {
// docs:start:is_initialized
unconstrained pub fn is_initialized(self) -> bool {
pub unconstrained fn is_initialized(self) -> bool {
let nullifier = self.compute_initialization_nullifier();
check_nullifier_exists(nullifier)
}
// docs:end:is_initialized

// view_note does not actually use the context, but it calls oracles that are only available in private
// docs:start:view_note
unconstrained pub fn view_note<let N: u32>(self) -> Note where Note: NoteInterface<N> + NullifiableNote {
pub unconstrained fn view_note<let N: u32>(self) -> Note where Note: NoteInterface<N> + NullifiableNote {
let mut options = NoteViewerOptions::new();
view_notes(self.storage_slot, options.set_limit(1)).get(0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ impl<Note, let N: u32> PrivateMutable<Note, &mut PrivateContext> where Note: Not
}

impl<Note, let N: u32> PrivateMutable<Note, UnconstrainedContext> where Note: NoteInterface<N> + NullifiableNote {
unconstrained pub fn is_initialized(self) -> bool {
pub unconstrained fn is_initialized(self) -> bool {
let nullifier = self.compute_initialization_nullifier();
check_nullifier_exists(nullifier)
}

// docs:start:view_note
unconstrained pub fn view_note(self) -> Note {
pub unconstrained fn view_note(self) -> Note {
let mut options = NoteViewerOptions::new();
view_notes(self.storage_slot, options.set_limit(1)).get(0)
}
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<Note, let N: u32> PrivateSet<Note, &mut PrivateContext> where Note: NoteInt

impl<Note, let N: u32> PrivateSet<Note, UnconstrainedContext> where Note: NoteInterface<N> + NullifiableNote {
// docs:start:view_notes
unconstrained pub fn view_notes(
pub unconstrained fn view_notes(
self,
options: NoteViewerOptions<Note, N>
) -> BoundedVec<Note, MAX_NOTES_PER_PAGE> {
Expand Down
Loading