aztec-nr - noir_aztec::note::note_message

Struct MaybeNoteMessage

pub struct MaybeNoteMessage<Note>
{ /* private fields */ }

Same as NoteMessage, except this type also handles the possibility where the note may not have been actually created depending on runtime conditions (e.g. a token transfer change note is not created if there is no change). Other than that, it and [MaybeNoteMessage::delivery] behave the exact same way as NoteMessage.

Implementations

impl<Note> MaybeNoteMessage<Note>

pub fn new(maybe_new_note: Option<NewNote<Note>>, context: &mut PrivateContext) -> Self
where Note: NoteType, Note: Packable
pub fn deliver(self, delivery_mode: u8)
where Note: NoteType, Note: Packable

Same as NoteMessage::deliver, except the message will only be delivered if it actually exists.

Messages delivered using crate::messages::message_delivery::MessageDeliveryEnum::CONSTRAINED_ONCHAIN will pay proving costs regardless of whether the message exists or not.

pub fn deliver_to(self, recipient: AztecAddress, delivery_mode: u8)
where Note: NoteType, Note: Packable

Same as NoteMessage::deliver_to, except the message will only be delivered if it actually exists.

Messages delivered using crate::messages::message_delivery::MessageDeliveryEnum::CONSTRAINED_ONCHAIN will pay proving costs regardless of whether the message exists or not.

pub fn get_note(self) -> Option<Note>
where Note: NoteType, Note: Packable

Returns the note contained in the message.