Skip to content

Commit

Permalink
removing ownednote from value note and uint note
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Aug 28, 2024
1 parent 7dfb173 commit f083f74
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
20 changes: 0 additions & 20 deletions noir-projects/aztec-nr/uint-note/src/uint_note.nr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ use dep::aztec::{
};
use dep::std::{embedded_curve_ops::multi_scalar_mul, hash::from_field_unsafe};

trait OwnedNote {
fn new(amount: U128, owner_npk_m_hash: Field) -> Self;
fn get_amount(self) -> U128;
}

global UINT_NOTE_LEN: Field = 3; // 3 plus a header.
global UINT_NOTE_BYTES_LEN: Field = 3 * 32 + 64;

Expand Down Expand Up @@ -113,18 +108,3 @@ impl Eq for UintNote {
(self.randomness == other.randomness)
}
}

impl OwnedNote for UintNote {
fn new(amount: U128, owner_npk_m_hash: Field) -> Self {
Self {
value: amount,
npk_m_hash: owner_npk_m_hash,
randomness: unsafe_rand(),
header: NoteHeader::empty(),
}
}

fn get_amount(self) -> U128 {
self.value
}
}
20 changes: 0 additions & 20 deletions noir-projects/aztec-nr/value-note/src/value_note.nr
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ global VALUE_NOTE_LEN: Field = 3; // 3 plus a header.
// VALUE_NOTE_LEN * 32 + 32(storage_slot as bytes) + 32(note_type_id as bytes)
global VALUE_NOTE_BYTES_LEN: Field = 3 * 32 + 64;

trait OwnedNote {
fn new(amount: U128, owner_npk_m_hash: Field) -> Self;
fn get_amount(self) -> U128;
}

// docs:start:value-note-def
#[aztec(note)]
struct ValueNote {
Expand Down Expand Up @@ -105,21 +100,6 @@ impl Eq for ValueNote {
}
}

impl OwnedNote for ValueNote {
fn new(value: U128, owner_npk_m_hash: Field) -> Self {
Self {
value: value.to_field(),
npk_m_hash: owner_npk_m_hash,
randomness: unsafe_rand(),
header: NoteHeader::empty(),
}
}

fn get_amount(self) -> U128 {
U128::from_field(self.value)
}
}

struct ValueNoteHidingPoint {
inner: Point
}
Expand Down

0 comments on commit f083f74

Please sign in to comment.