From cf0a3cf8489cd84c7b2642c0bc7b50c5dee9a095 Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 13:15:50 +0300 Subject: Add config property to DB --- src/db.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/db.rs b/src/db.rs index a00def5..85d43a0 100644 --- a/src/db.rs +++ b/src/db.rs @@ -10,6 +10,7 @@ //! with their public keys, `metu_ids` and gradecoin balances. use crate::block::{Block, Fingerprint, Id, Transaction}; use crate::student::{MetuId, User, UserAtRest}; +use crate::config::Config; use log::debug; use parking_lot::RwLock; use std::{collections::HashMap, fs, io, path::PathBuf, sync::Arc}; @@ -21,6 +22,7 @@ pub struct Db { pub blockchain: Arc>, pub pending_transactions: Arc>>, pub users: Arc>>, + pub config: Config, preapproved_users: Vec, } @@ -44,6 +46,14 @@ impl Db { blockchain: Arc::new(RwLock::new(Block::default())), pending_transactions: Arc::new(RwLock::new(HashMap::new())), users: Arc::new(RwLock::new(users)), + config: Config { + block_transaction_count: 4, + register_bonus: 100, + block_reward: 4, + tx_upper_limit: 4, + tx_lower_limit: 1, + tx_traffic_reward: 1, + }, preapproved_users, } } -- cgit v1.2.3-70-g09d2