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;