diff options
author | necrashter | 2022-04-23 13:15:06 +0300 |
---|---|---|
committer | Yigit Sever | 2022-04-23 18:10:12 +0300 |
commit | 426ce6b84fe6cba6fd4947fb54ba5d5837c65b73 (patch) | |
tree | 93e5dcdc786031f0c2ae27bf90b41a48f6f90abe /src | |
parent | 647967f271d356c3d309ab24ca96fd09f4c87829 (diff) | |
download | gradecoin-426ce6b84fe6cba6fd4947fb54ba5d5837c65b73.tar.gz gradecoin-426ce6b84fe6cba6fd4947fb54ba5d5837c65b73.tar.bz2 gradecoin-426ce6b84fe6cba6fd4947fb54ba5d5837c65b73.zip |
Add basic config struct
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs | 20 | ||||
-rw-r--r-- | src/main.rs | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..80d2def --- /dev/null +++ b/src/config.rs | |||
@@ -0,0 +1,20 @@ | |||
1 | //! # Configuration | ||
2 | //! | ||
3 | //! This module holds the data structures for network configuration. | ||
4 | use serde::{Deserialize, Serialize}; | ||
5 | |||
6 | /// Configuration for a single network | ||
7 | #[derive(Debug, Serialize, Deserialize, Clone, Default)] | ||
8 | pub struct Config { | ||
9 | // Valid blocks should have this many transactions | ||
10 | pub block_transaction_count: u8, | ||
11 | // Inital registration bonus | ||
12 | pub register_bonus: u16, | ||
13 | // Coinbase reward | ||
14 | pub block_reward: u16, | ||
15 | // Transaction amount limit | ||
16 | pub tx_upper_limit: u16, | ||
17 | pub tx_lower_limit: u16, | ||
18 | // Transaction traffic reward | ||
19 | pub tx_traffic_reward: u16, | ||
20 | } | ||
diff --git a/src/main.rs b/src/main.rs index f0027f2..57ee526 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -29,6 +29,7 @@ mod handlers; | |||
29 | mod routes; | 29 | mod routes; |
30 | mod block; | 30 | mod block; |
31 | mod student; | 31 | mod student; |
32 | mod config; | ||
32 | 33 | ||
33 | pub use block::{Fingerprint, Id}; | 34 | pub use block::{Fingerprint, Id}; |
34 | use db::Db; | 35 | use db::Db; |