Skip to content

Commit

Permalink
fix(docs): Update 0.22 migration_notes.md w/ proper note interface (#…
Browse files Browse the repository at this point in the history
…4701)

Updates the reference to 0.22 changes in the migration notes to use the
correct note interface
  • Loading branch information
critesjosh committed Feb 22, 2024
1 parent 5c232af commit a972dc8
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions docs/docs/misc/migration_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,22 +394,8 @@ impl CardNote {
}
}

impl Serialize<CARD_NOTE_LEN> for CardNote {
fn serialize(self) -> [Field; CARD_NOTE_LEN] {
[self.owner.to_field()]
}
}

impl Deserialize<CARD_NOTE_LEN> for CardNote {
fn deserialize(serialized_note: [Field; CARD_NOTE_LEN]) -> Self {
CardNote {
owner: AztecAddress::from_field(serialized_note[2]),
}
}
}

impl NoteInterface for CardNote {
fn compute_note_hash(self) -> Field {
fn compute_note_content_hash(self) -> Field {
pedersen_hash([
self.owner.to_field(),
],0)
Expand Down Expand Up @@ -443,6 +429,17 @@ impl NoteInterface for CardNote {
note.header
}

fn serialize_content(self) -> [Field; CARD_NOTE_LEN]{
[self.owner.to_field()]
}

fn deserialize_content(serialized_note: [Field; CARD_NOTE_LEN]) -> Self {
AddressNote {
owner: AztecAddress::from_field(serialized_note[0]),
header: NoteHeader::empty(),
}
}

// Broadcasts the note as an encrypted log on L1.
fn broadcast(self, context: &mut PrivateContext, slot: Field) {
let encryption_pub_key = get_public_key(self.owner);
Expand Down

0 comments on commit a972dc8

Please sign in to comment.