diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs | 15 |
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. |
4 | use crate::block::Fingerprint; | ||
4 | use log::{error, info}; | 5 | use log::{error, info}; |
5 | use serde::{Deserialize, Serialize}; | 6 | use serde::{Deserialize, Serialize}; |
7 | use std::collections::HashMap; | ||
8 | |||
9 | |||
10 | /// Configuration struct for a single bot | ||
11 | #[derive(Debug, Serialize, Deserialize, Clone, Default)] | ||
12 | pub 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 | ||
52 | impl Config { | 67 | impl Config { |