aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornecrashter2022-04-23 22:44:30 +0300
committerYigit Sever2022-04-23 23:12:09 +0300
commit6737ce1650dab4819a33ac03ff3e9c8bb09d3645 (patch)
tree072d98376b1a18f9e48ad017da63808b88cc31ce
parent3ec12ea0fdf179dc9f45a550fd6e60c9501790d5 (diff)
downloadgradecoin-6737ce1650dab4819a33ac03ff3e9c8bb09d3645.tar.gz
gradecoin-6737ce1650dab4819a33ac03ff3e9c8bb09d3645.tar.bz2
gradecoin-6737ce1650dab4819a33ac03ff3e9c8bb09d3645.zip
Bot config representation
-rw-r--r--src/config.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 112fb3c..0584c31 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,8 +1,19 @@
1//! # Configuration 1//! # Configuration
2//! 2//!
3//! This module holds the data structures for network configuration. 3//! This module holds the data structures for network configuration.
4use crate::block::Fingerprint;
4use log::{error, info}; 5use log::{error, info};
5use serde::{Deserialize, Serialize}; 6use serde::{Deserialize, Serialize};
7use std::collections::HashMap;
8
9
10/// Configuration struct for a single bot
11#[derive(Debug, Serialize, Deserialize, Clone, Default)]
12pub struct BotConfig {
13 /// The initial balance of this bot.
14 pub starting_balance: u16,
15}
16
6 17
7/// Configuration for a single network 18/// Configuration for a single network
8#[derive(Debug, Serialize, Deserialize, Clone, Default)] 19#[derive(Debug, Serialize, Deserialize, Clone, Default)]
@@ -47,6 +58,10 @@ pub struct Config {
47 58
48 /// Transaction traffic reward 59 /// Transaction traffic reward
49 pub tx_traffic_reward: u16, 60 pub tx_traffic_reward: u16,
61
62 /// The configuration of the bots in this network.
63 /// Maps bot fingerprints to their configurations.
64 pub bots: HashMap<Fingerprint, BotConfig>,
50} 65}
51 66
52impl Config { 67impl Config {