nostrdb-rs

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

commit 87bf139e699c2493b3242e3d7472acb2cf2683f6
parent 5010624faf49f174e0a1761b535ad65c1644ecc3
Author: William Casarin <jb55@jb55.com>
Date:   Sun,  7 Apr 2024 13:19:42 -0700

note: expose signature field

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 @@ -141,6 +141,13 @@ impl<'a> Note<'a> { let tags = unsafe { bindings::ndb_note_tags(self.as_ptr()) }; Tags::new(tags, self) } + + pub fn sig(&self) -> &'a [u8; 32] { + unsafe { + let ptr = bindings::ndb_note_sig(self.as_ptr()); + &*(ptr as *const [u8; 32]) + } + } } impl<'a> Drop for Note<'a> {