Skip to content

Commit

Permalink
Add Node DB state generic
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan770 committed Jun 9, 2020
1 parent 46ac394 commit 68ac9e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spartan/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ pub use persistence::{load_from_fs, spawn_persistence};
use crate::server::Config;
use async_std::sync::{Mutex, MutexGuard};
use spartan_lib::core::{db::tree::TreeDatabase, message::Message};
use std::{collections::HashMap, fmt::Display};
use std::{collections::{hash_map::RandomState, HashMap}, fmt::Display};

pub type DB = TreeDatabase<Message>;
type MutexDB = Mutex<DB>;

#[derive(Default)]
pub struct Node {
db: HashMap<String, MutexDB>,
pub struct Node<S = RandomState> {
db: HashMap<String, MutexDB, S>,
}

impl Node {
Expand Down

0 comments on commit 68ac9e0

Please sign in to comment.