rename dynbox to dynpeer

Niko 2 years ago
parent 4545d3b5b9
commit 58e80b02cc
  1. 12
      ngone/src/store/dynpeer.rs
  2. 2
      ngone/src/store/mod.rs

@ -17,13 +17,13 @@ use p2p_repo::types::PubKey;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_bare::{from_slice, to_vec}; use serde_bare::{from_slice, to_vec};
pub struct DynBox<'a> { pub struct DynPeer<'a> {
/// peer ID /// peer ID
id: PubKey, id: PubKey,
store: &'a dyn KCVStore, store: &'a dyn KCVStore,
} }
impl<'a> DynBox<'a> { impl<'a> DynPeer<'a> {
const PREFIX: u8 = b"d"[0]; const PREFIX: u8 = b"d"[0];
// properties' suffixes // properties' suffixes
@ -33,8 +33,8 @@ impl<'a> DynBox<'a> {
const SUFFIX_FOR_EXIST_CHECK: u8 = Self::ADDRS; const SUFFIX_FOR_EXIST_CHECK: u8 = Self::ADDRS;
pub fn open(id: &PubKey, store: &'a dyn KCVStore) -> Result<DynBox<'a>, StorageError> { pub fn open(id: &PubKey, store: &'a dyn KCVStore) -> Result<DynPeer<'a>, StorageError> {
let opening = DynBox { let opening = DynPeer {
id: id.clone(), id: id.clone(),
store, store,
}; };
@ -47,8 +47,8 @@ impl<'a> DynBox<'a> {
id: &PubKey, id: &PubKey,
addrs: &Vec<NetAddr>, addrs: &Vec<NetAddr>,
store: &'a dyn KCVStore, store: &'a dyn KCVStore,
) -> Result<DynBox<'a>, StorageError> { ) -> Result<DynPeer<'a>, StorageError> {
let acc = DynBox { let acc = DynPeer {
id: id.clone(), id: id.clone(),
store, store,
}; };

@ -1,3 +1,3 @@
pub mod dynbox; pub mod dynpeer;
pub mod wallet_record; pub mod wallet_record;

Loading…
Cancel
Save