From a972dc8b0d62ba8e3fbbb9aed7f523ebd2b06f59 Mon Sep 17 00:00:00 2001 From: josh crites Date: Thu, 22 Feb 2024 15:46:30 +0000 Subject: [PATCH] fix(docs): Update 0.22 migration_notes.md w/ proper note interface (#4701) Updates the reference to 0.22 changes in the migration notes to use the correct note interface --- docs/docs/misc/migration_notes.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/docs/misc/migration_notes.md b/docs/docs/misc/migration_notes.md index 6009c4d2809..4c1d9253bb7 100644 --- a/docs/docs/misc/migration_notes.md +++ b/docs/docs/misc/migration_notes.md @@ -394,22 +394,8 @@ impl CardNote { } } -impl Serialize for CardNote { - fn serialize(self) -> [Field; CARD_NOTE_LEN] { - [self.owner.to_field()] - } -} - -impl Deserialize 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) @@ -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);