nostrdb-rs

nostrdb in rust!
git clone git://jb55.com/nostrdb-rs
Log | Files | Refs | Submodules | README | LICENSE

commit 466b25175fbbc20bbe8978e68fdf47afc002dbb0
parent 1ebdd4177ea93962ea111b8c10598af12539b649
Author: William Casarin <jb55@jb55.com>
Date:   Wed,  7 Feb 2024 17:37:35 -0800

note: get transaction from note

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/note.rs | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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<NoteKey> { match self { Note::Transactional { key, .. } => Some(NoteKey::new(key.as_u64())),