Skip to content

Commit

Permalink
note: get transaction from note
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Feb 8, 2024
1 parent 1ebdd41 commit 466b251
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NoteKey> {
match self {
Note::Transactional { key, .. } => Some(NoteKey::new(key.as_u64())),
Expand Down

0 comments on commit 466b251

Please sign in to comment.