From 6737ce1650dab4819a33ac03ff3e9c8bb09d3645 Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 22:44:30 +0300 Subject: Bot config representation --- src/config.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/config.rs') 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 @@ //! # Configuration //! //! This module holds the data structures for network configuration. +use crate::block::Fingerprint; use log::{error, info}; use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + + +/// Configuration struct for a single bot +#[derive(Debug, Serialize, Deserialize, Clone, Default)] +pub struct BotConfig { + /// The initial balance of this bot. + pub starting_balance: u16, +} + /// Configuration for a single network #[derive(Debug, Serialize, Deserialize, Clone, Default)] @@ -47,6 +58,10 @@ pub struct Config { /// Transaction traffic reward pub tx_traffic_reward: u16, + + /// The configuration of the bots in this network. + /// Maps bot fingerprints to their configurations. + pub bots: HashMap, } impl Config { -- cgit v1.2.3-70-g09d2