aboutsummaryrefslogtreecommitdiffstats
path: root/src/handlers.rs
diff options
context:
space:
mode:
authorYigit Sever2022-04-15 19:01:40 +0300
committerYigit Sever2022-04-15 19:01:40 +0300
commitf12685e32689b620d6096ec91ba3a3f495342925 (patch)
tree7f7ba75511980e1877a3ffde53fc51399205660c /src/handlers.rs
parentbacedcecc51d4f8be610c6a1f4c1d0643faf8146 (diff)
downloadgradecoin-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.rs9
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};
27use crate::PRIVATE_KEY; 27use crate::PRIVATE_KEY;
28 28
29// Valid blocks should have this many transactions 29// Valid blocks should have this many transactions
30const BLOCK_TRANSACTION_COUNT: u8 = 8; 30const BLOCK_TRANSACTION_COUNT: u8 = 4;
31// Inital registration bonus 31// Inital registration bonus
32const REGISTER_BONUS: u16 = 40; 32const REGISTER_BONUS: u16 = 20;
33// Coinbase reward 33// Coinbase reward
34const BLOCK_REWARD: u16 = 3; 34const BLOCK_REWARD: u16 = 2;
35// Transaction amount limit 35// Transaction amount limit
36const TX_UPPER_LIMIT: u16 = 10; 36const TX_UPPER_LIMIT: u16 = 4;
37const TX_LOWER_LIMIT: u16 = 1; 37const TX_LOWER_LIMIT: u16 = 1;
38// Transaction traffic reward 38// Transaction traffic reward
39const TX_TRAFFIC_REWARD: u16 = 1; 39const 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