Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed May 17, 2024
1 parent 7bce416 commit 1c97fa1
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions noir-projects/aztec-nr/value-note/src/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ pub fn create_note_getter_options_for_decreasing_balance(amount: Field) -> NoteG

// Creates a new note for the recipient.
// Inserts it to the recipient's set of notes.
pub fn increment(
balance: PrivateSet<ValueNote>,
amount: Field,
recipient: AztecAddress
) {
pub fn increment(balance: PrivateSet<ValueNote>, amount: Field, recipient: AztecAddress) {
let context = balance.context.private.unwrap();
let recipient_npk_m_hash = get_npk_m_hash(context, recipient);
let recipient_ivpk_m = get_ivpk_m(context, recipient);
Expand All @@ -30,11 +26,7 @@ pub fn increment(
// Remove those notes.
// If the value of the removed notes exceeds the requested `amount`, create a new note containing the excess value, so that exactly `amount` is removed.
// Fail if the sum of the selected notes is less than the amount.
pub fn decrement(
balance: PrivateSet<ValueNote>,
amount: Field,
owner: AztecAddress
) {
pub fn decrement(balance: PrivateSet<ValueNote>, amount: Field, owner: AztecAddress) {
let sum = decrement_by_at_most(balance, amount, owner);
assert(sum == amount, "Balance too low");
}
Expand Down Expand Up @@ -75,11 +67,7 @@ pub fn decrement_by_at_most(

// Removes the note from the owner's set of notes.
// Returns the value of the destroyed note.
pub fn destroy_note(
balance: PrivateSet<ValueNote>,
owner: AztecAddress,
note: ValueNote
) -> Field {
pub fn destroy_note(balance: PrivateSet<ValueNote>, owner: AztecAddress, note: ValueNote) -> Field {
// Ensure the note is actually owned by the owner (to prevent user from generating a valid proof while
// spending someone else's notes).
let owner_npk_m_hash = get_npk_m_hash(balance.context.private.unwrap(), owner);
Expand Down

0 comments on commit 1c97fa1

Please sign in to comment.