From 58e80b02ccc0097a650b753b13bee8c24f3a3ed0 Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 2 Jun 2023 21:49:38 +0300 Subject: [PATCH] rename dynbox to dynpeer --- ngone/src/store/{dynbox.rs => dynpeer.rs} | 12 ++++++------ ngone/src/store/mod.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) rename ngone/src/store/{dynbox.rs => dynpeer.rs} (93%) diff --git a/ngone/src/store/dynbox.rs b/ngone/src/store/dynpeer.rs similarity index 93% rename from ngone/src/store/dynbox.rs rename to ngone/src/store/dynpeer.rs index ffed72a..1b7dc4b 100644 --- a/ngone/src/store/dynbox.rs +++ b/ngone/src/store/dynpeer.rs @@ -17,13 +17,13 @@ use p2p_repo::types::PubKey; use serde::{Deserialize, Serialize}; use serde_bare::{from_slice, to_vec}; -pub struct DynBox<'a> { +pub struct DynPeer<'a> { /// peer ID id: PubKey, store: &'a dyn KCVStore, } -impl<'a> DynBox<'a> { +impl<'a> DynPeer<'a> { const PREFIX: u8 = b"d"[0]; // properties' suffixes @@ -33,8 +33,8 @@ impl<'a> DynBox<'a> { const SUFFIX_FOR_EXIST_CHECK: u8 = Self::ADDRS; - pub fn open(id: &PubKey, store: &'a dyn KCVStore) -> Result, StorageError> { - let opening = DynBox { + pub fn open(id: &PubKey, store: &'a dyn KCVStore) -> Result, StorageError> { + let opening = DynPeer { id: id.clone(), store, }; @@ -47,8 +47,8 @@ impl<'a> DynBox<'a> { id: &PubKey, addrs: &Vec, store: &'a dyn KCVStore, - ) -> Result, StorageError> { - let acc = DynBox { + ) -> Result, StorageError> { + let acc = DynPeer { id: id.clone(), store, }; diff --git a/ngone/src/store/mod.rs b/ngone/src/store/mod.rs index b185ee0..451582e 100644 --- a/ngone/src/store/mod.rs +++ b/ngone/src/store/mod.rs @@ -1,3 +1,3 @@ -pub mod dynbox; +pub mod dynpeer; pub mod wallet_record;