From 1ebdd4177ea93962ea111b8c10598af12539b649 Mon Sep 17 00:00:00 2001
From: William Casarin <jb55@jb55.com>
Date: Wed, 7 Feb 2024 17:32:35 -0800
Subject: [PATCH] switch to NoteKey in more places

Signed-off-by: William Casarin <jb55@jb55.com>
---
 src/ndb.rs | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/ndb.rs b/src/ndb.rs
index fee2ae0..d5b803d 100644
--- 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);