Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Oct 29, 2024
1 parent 0fe64df commit 0dd2b68
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions noir-projects/aztec-nr/address-note/src/address_note.nr
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ use dep::aztec::{
oracle::random::random,
protocol_types::{
address::AztecAddress, constants::GENERATOR_INDEX__NOTE_NULLIFIER,
hash::poseidon2_hash_with_separator,
hash::poseidon2_hash_with_separator, traits::Serialize,
},
};

// docs:start:address_note_def
// docs:start:address_note_struct
// Stores an address
#[note]
#[derive(Serialize)]
pub struct AddressNote {
address: AztecAddress,
// The nullifying public key hash is used with the nsk_app to ensure that the note can be privately spent.
Expand All @@ -26,7 +27,6 @@ pub struct AddressNote {
// docs:end:address_note_struct

impl NullifiableNote for AddressNote {

fn compute_nullifier(
self,
context: &mut PrivateContext,
Expand Down Expand Up @@ -62,3 +62,11 @@ impl AddressNote {
}
// docs:end:address_note_def
}

impl Eq for AddressNote {
fn eq(self, other: Self) -> bool {
(self.address == other.address)
& (self.owner == other.owner)
& (self.randomness == other.randomness)
}
}

0 comments on commit 0dd2b68

Please sign in to comment.