nostrdb-rs

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

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

switch to NoteKey in more places

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

Diffstat:
Msrc/ndb.rs | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/ndb.rs b/src/ndb.rs @@ -224,9 +224,14 @@ impl Ndb { Ok(res) } - pub fn get_blocks_by_key<'a>(&self, txn: &'a Transaction, note_key: u64) -> Result<Blocks<'a>> { - let blocks_ptr = - unsafe { bindings::ndb_get_blocks_by_key(self.as_ptr(), txn.as_mut_ptr(), note_key) }; + pub fn get_blocks_by_key<'a>( + &self, + txn: &'a Transaction, + note_key: NoteKey, + ) -> Result<Blocks<'a>> { + let blocks_ptr = unsafe { + bindings::ndb_get_blocks_by_key(self.as_ptr(), txn.as_mut_ptr(), note_key.as_u64()) + }; if blocks_ptr.is_null() { return Err(Error::NotFound);