From f083f74d776cab9a08460032ba0d34b31c2c0b87 Mon Sep 17 00:00:00 2001 From: sklppy88 Date: Wed, 28 Aug 2024 20:26:44 +0000 Subject: [PATCH] removing ownednote from value note and uint note --- .../aztec-nr/uint-note/src/uint_note.nr | 20 ------------------- .../aztec-nr/value-note/src/value_note.nr | 20 ------------------- 2 files changed, 40 deletions(-) diff --git a/noir-projects/aztec-nr/uint-note/src/uint_note.nr b/noir-projects/aztec-nr/uint-note/src/uint_note.nr index c431cb36c70..0284fe7d6a2 100644 --- a/noir-projects/aztec-nr/uint-note/src/uint_note.nr +++ b/noir-projects/aztec-nr/uint-note/src/uint_note.nr @@ -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; @@ -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 - } -} diff --git a/noir-projects/aztec-nr/value-note/src/value_note.nr b/noir-projects/aztec-nr/value-note/src/value_note.nr index d1d39741e0f..38809bc7e54 100644 --- a/noir-projects/aztec-nr/value-note/src/value_note.nr +++ b/noir-projects/aztec-nr/value-note/src/value_note.nr @@ -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 { @@ -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 }