From 466b25175fbbc20bbe8978e68fdf47afc002dbb0 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Wed, 7 Feb 2024 17:37:35 -0800 Subject: [PATCH] note: get transaction from note Signed-off-by: William Casarin --- src/note.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/note.rs b/src/note.rs index 6e7d7db..62d4ac9 100644 --- a/src/note.rs +++ b/src/note.rs @@ -66,6 +66,13 @@ impl<'a> Note<'a> { } } + pub fn txn(&'a self) -> Option<&'a Transaction> { + match self { + Note::Transactional { transaction, .. } => Some(transaction), + _ => None, + } + } + pub fn key(&self) -> Option { match self { Note::Transactional { key, .. } => Some(NoteKey::new(key.as_u64())),