From f4c9db5d26761dd1f67b4e770a42a75d8a0b0321 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Sat, 27 Apr 2024 09:36:51 +0300 Subject: [PATCH] fix ngone after KCV API change --- ngone/src/store/dynpeer.rs | 15 +++++++++++---- ngone/src/store/wallet_record.rs | 28 +++++++++++++++++++--------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/ngone/src/store/dynpeer.rs b/ngone/src/store/dynpeer.rs index e381265..d678f08 100644 --- a/ngone/src/store/dynpeer.rs +++ b/ngone/src/store/dynpeer.rs @@ -61,6 +61,7 @@ impl<'a> DynPeer<'a> { &to_vec(&id)?, Some(Self::ADDRS), &to_vec(&addrs)?, + &None, )?; Ok(()) })?; @@ -72,6 +73,7 @@ impl<'a> DynPeer<'a> { Self::PREFIX, &to_vec(&self.id).unwrap(), Some(Self::SUFFIX_FOR_EXIST_CHECK), + &None, ) .is_ok() } @@ -86,16 +88,21 @@ impl<'a> DynPeer<'a> { Self::PREFIX, &to_vec(&self.id)?, Some(Self::ADDRS), - to_vec(addrs)?, + &to_vec(addrs)?, + &None, ) } pub fn remove_addresses(&self) -> Result<(), StorageError> { self.store - .del(Self::PREFIX, &to_vec(&self.id)?, Some(Self::ADDRS)) + .del(Self::PREFIX, &to_vec(&self.id)?, Some(Self::ADDRS), &None) } pub fn del(&self) -> Result<(), StorageError> { - self.store - .del_all(Self::PREFIX, &to_vec(&self.id)?, &Self::ALL_PROPERTIES) + self.store.del_all( + Self::PREFIX, + &to_vec(&self.id)?, + &Self::ALL_PROPERTIES, + &None, + ) } } diff --git a/ngone/src/store/wallet_record.rs b/ngone/src/store/wallet_record.rs index 3f69f1a..7200342 100644 --- a/ngone/src/store/wallet_record.rs +++ b/ngone/src/store/wallet_record.rs @@ -64,6 +64,7 @@ impl<'a> WalletRecord<'a> { &to_vec(&id)?, Some(Self::BOOTSTRAP), &to_vec(bootstrap)?, + &None, )?; Ok(()) })?; @@ -75,6 +76,7 @@ impl<'a> WalletRecord<'a> { Self::PREFIX, &to_vec(&self.id).unwrap(), Some(Self::SUFFIX_FOR_EXIST_CHECK), + &None, ) .is_ok() } @@ -89,7 +91,8 @@ impl<'a> WalletRecord<'a> { Self::PREFIX, &to_vec(&self.id)?, Some(Self::WALLET), - to_vec(wallet)?, + &to_vec(wallet)?, + &None, ) } @@ -101,14 +104,15 @@ impl<'a> WalletRecord<'a> { Self::PREFIX, &to_vec(&self.id)?, Some(Self::BOOTSTRAP), - to_vec(boot)?, + &to_vec(boot)?, + &None, ) } pub fn wallet(&self) -> Result { match self .store - .get(Self::PREFIX, &to_vec(&self.id)?, Some(Self::WALLET)) + .get(Self::PREFIX, &to_vec(&self.id)?, Some(Self::WALLET), &None) { Ok(w) => Ok(from_slice::(&w)?), Err(e) => Err(e), @@ -116,17 +120,23 @@ impl<'a> WalletRecord<'a> { } pub fn bootstrap(&self) -> Result { - match self - .store - .get(Self::PREFIX, &to_vec(&self.id)?, Some(Self::BOOTSTRAP)) - { + match self.store.get( + Self::PREFIX, + &to_vec(&self.id)?, + Some(Self::BOOTSTRAP), + &None, + ) { Ok(meta) => Ok(from_slice::(&meta)?), Err(e) => Err(e), } } pub fn del(&self) -> Result<(), StorageError> { - self.store - .del_all(Self::PREFIX, &to_vec(&self.id)?, &Self::ALL_PROPERTIES) + self.store.del_all( + Self::PREFIX, + &to_vec(&self.id)?, + &Self::ALL_PROPERTIES, + &None, + ) } }