Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jun 20, 2024
1 parent c42f415 commit 1db44a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
messaging::process_l1_to_l2_message,
hash::{hash_args_array, ArgsHasher, compute_unencrypted_log_hash},
keys::constants::{NULLIFIER_INDEX, OUTGOING_INDEX, NUM_KEY_TYPES, sk_generators},
note::{note_interface::NoteInterface, utils::compute_note_hash_for_insertion},
note::note_interface::NoteInterface,
oracle::{
key_validation_request::get_key_validation_request, arguments, returns::pack_returns,
call_private_function::call_private_function_internal, header::get_header_at,
Expand Down
7 changes: 3 additions & 4 deletions noir-projects/aztec-nr/aztec/src/note/lifecycle.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use dep::protocol_types::grumpkin_point::GrumpkinPoint;
use crate::context::{PrivateContext, PublicContext};
use crate::note::{
note_header::NoteHeader, note_interface::NoteInterface,
utils::{compute_note_hash_for_insertion, compute_note_hash_for_consumption},
note_emission::NoteEmission
utils::{compute_inner_note_hash, compute_note_hash_for_consumption}, note_emission::NoteEmission
};
use crate::oracle::notes::{notify_created_note, notify_nullified_note};

Expand All @@ -18,7 +17,7 @@ pub fn create_note<Note, N, M>(
let header = NoteHeader { contract_address, storage_slot, nonce: 0, note_hash_counter };
// TODO: change this to note.set_header(header) once https://github.com/noir-lang/noir/issues/4095 is fixed
Note::set_header(note, header);
let inner_note_hash = compute_note_hash_for_insertion(*note);
let inner_note_hash = compute_inner_note_hash(*note);

// TODO: Strong typing required because of https://github.com/noir-lang/noir/issues/4088
let serialized_note: [Field; N] = Note::serialize_content(*note);
Expand Down Expand Up @@ -47,7 +46,7 @@ pub fn create_note_hash_from_public<Note, N, M>(
// Public note hashes are transient, but have no side effect counters, so we just need note_hash_counter != 0
let header = NoteHeader { contract_address, storage_slot, nonce: 0, note_hash_counter: 1 };
note.set_header(header);
let inner_note_hash = compute_note_hash_for_insertion(*note);
let inner_note_hash = compute_inner_note_hash(*note);

context.push_new_note_hash(inner_note_hash);
}
Expand Down
4 changes: 0 additions & 4 deletions noir-projects/aztec-nr/aztec/src/note/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ pub fn compute_siloed_nullifier<Note, N, M>(
compute_siloed_nullifier_from_preimage(header.contract_address, inner_nullifier)
}

pub fn compute_note_hash_for_insertion<Note, N, M>(note: Note) -> Field where Note: NoteInterface<N, M> {
compute_inner_note_hash(note)
}

pub fn compute_note_hash_for_read_request<Note, N, M>(note: Note) -> Field where Note: NoteInterface<N, M> {
let header = note.get_header();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::hash::hash_args;

use crate::note::{
note_header::NoteHeader, note_interface::NoteInterface,
utils::{compute_note_hash_for_insertion, compute_note_hash_for_consumption}
utils::{compute_inner_note_hash, compute_note_hash_for_consumption}
};
use crate::oracle::notes::notify_created_note;

Expand Down Expand Up @@ -188,7 +188,7 @@ impl TestEnvironment {
let header = NoteHeader { contract_address, storage_slot, nonce: 0, note_hash_counter };
// TODO: change this to note.set_header(header) once https://github.com/noir-lang/noir/issues/4095 is fixed
Note::set_header(note, header);
let inner_note_hash = compute_note_hash_for_insertion(*note);
let inner_note_hash = compute_inner_note_hash(*note);

// TODO: Strong typing required because of https://github.com/noir-lang/noir/issues/4088
let serialized_note: [Field; N] = Note::serialize_content(*note);
Expand Down

0 comments on commit 1db44a4

Please sign in to comment.