diff options
author | Yigit Sever | 2022-04-15 19:01:40 +0300 |
---|---|---|
committer | Yigit Sever | 2022-04-15 19:01:40 +0300 |
commit | f12685e32689b620d6096ec91ba3a3f495342925 (patch) | |
tree | 7f7ba75511980e1877a3ffde53fc51399205660c /src/handlers.rs | |
parent | bacedcecc51d4f8be610c6a1f4c1d0643faf8146 (diff) | |
download | gradecoin-f12685e32689b620d6096ec91ba3a3f495342925.tar.gz gradecoin-f12685e32689b620d6096ec91ba3a3f495342925.tar.bz2 gradecoin-f12685e32689b620d6096ec91ba3a3f495342925.zip |
[WIP] first part of lazy users overhaul
Diffstat (limited to 'src/handlers.rs')
-rw-r--r-- | src/handlers.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/handlers.rs b/src/handlers.rs index a64c012..96001ce 100644 --- a/src/handlers.rs +++ b/src/handlers.rs | |||
@@ -27,13 +27,13 @@ use warp::{http::StatusCode, reply}; | |||
27 | use crate::PRIVATE_KEY; | 27 | use crate::PRIVATE_KEY; |
28 | 28 | ||
29 | // Valid blocks should have this many transactions | 29 | // Valid blocks should have this many transactions |
30 | const BLOCK_TRANSACTION_COUNT: u8 = 8; | 30 | const BLOCK_TRANSACTION_COUNT: u8 = 4; |
31 | // Inital registration bonus | 31 | // Inital registration bonus |
32 | const REGISTER_BONUS: u16 = 40; | 32 | const REGISTER_BONUS: u16 = 20; |
33 | // Coinbase reward | 33 | // Coinbase reward |
34 | const BLOCK_REWARD: u16 = 3; | 34 | const BLOCK_REWARD: u16 = 2; |
35 | // Transaction amount limit | 35 | // Transaction amount limit |
36 | const TX_UPPER_LIMIT: u16 = 10; | 36 | const TX_UPPER_LIMIT: u16 = 4; |
37 | const TX_LOWER_LIMIT: u16 = 1; | 37 | const TX_LOWER_LIMIT: u16 = 1; |
38 | // Transaction traffic reward | 38 | // Transaction traffic reward |
39 | const TX_TRAFFIC_REWARD: u16 = 1; | 39 | const TX_TRAFFIC_REWARD: u16 = 1; |
@@ -278,6 +278,7 @@ pub async fn authenticate_user( | |||
278 | }; | 278 | }; |
279 | 279 | ||
280 | // is the student in AuthRequest privileged? | 280 | // is the student in AuthRequest privileged? |
281 | // TODO: this is the only check for 'if metuid is approved' <15-04-22, yigit> // | ||
281 | let privileged_student_id = | 282 | let privileged_student_id = |
282 | if let Some(id) = MetuId::new(request.student_id.clone(), request.passwd.clone()) { | 283 | if let Some(id) = MetuId::new(request.student_id.clone(), request.passwd.clone()) { |
283 | id | 284 | id |