aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock63
-rw-r--r--Cargo.toml1
-rw-r--r--src/handlers.rs9
3 files changed, 0 insertions, 73 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 1cec047..8228d5f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -352,12 +352,6 @@ dependencies = [
352] 352]
353 353
354[[package]] 354[[package]]
355name = "fuchsia-cprng"
356version = "0.1.1"
357source = "registry+https://github.com/rust-lang/crates.io-index"
358checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
359
360[[package]]
361name = "fuchsia-zircon" 355name = "fuchsia-zircon"
362version = "0.3.3" 356version = "0.3.3"
363source = "registry+https://github.com/rust-lang/crates.io-index" 357source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -486,7 +480,6 @@ dependencies = [
486 "hex-literal", 480 "hex-literal",
487 "jsonwebtoken", 481 "jsonwebtoken",
488 "lazy_static", 482 "lazy_static",
489 "libmath",
490 "log", 483 "log",
491 "log4rs", 484 "log4rs",
492 "md-5", 485 "md-5",
@@ -749,15 +742,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
749checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" 742checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
750 743
751[[package]] 744[[package]]
752name = "libmath"
753version = "0.2.1"
754source = "registry+https://github.com/rust-lang/crates.io-index"
755checksum = "dfd3416934a853ae80d5c3b006f632dfcbaf320300c5167e88a469e9ac214502"
756dependencies = [
757 "rand 0.3.23",
758]
759
760[[package]]
761name = "linked-hash-map" 745name = "linked-hash-map"
762version = "0.5.4" 746version = "0.5.4"
763source = "registry+https://github.com/rust-lang/crates.io-index" 747source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1211,29 +1195,6 @@ checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8"
1211 1195
1212[[package]] 1196[[package]]
1213name = "rand" 1197name = "rand"
1214version = "0.3.23"
1215source = "registry+https://github.com/rust-lang/crates.io-index"
1216checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
1217dependencies = [
1218 "libc",
1219 "rand 0.4.6",
1220]
1221
1222[[package]]
1223name = "rand"
1224version = "0.4.6"
1225source = "registry+https://github.com/rust-lang/crates.io-index"
1226checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
1227dependencies = [
1228 "fuchsia-cprng",
1229 "libc",
1230 "rand_core 0.3.1",
1231 "rdrand",
1232 "winapi 0.3.9",
1233]
1234
1235[[package]]
1236name = "rand"
1237version = "0.7.3" 1198version = "0.7.3"
1238source = "registry+https://github.com/rust-lang/crates.io-index" 1199source = "registry+https://github.com/rust-lang/crates.io-index"
1239checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1200checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
@@ -1279,21 +1240,6 @@ dependencies = [
1279 1240
1280[[package]] 1241[[package]]
1281name = "rand_core" 1242name = "rand_core"
1282version = "0.3.1"
1283source = "registry+https://github.com/rust-lang/crates.io-index"
1284checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
1285dependencies = [
1286 "rand_core 0.4.2",
1287]
1288
1289[[package]]
1290name = "rand_core"
1291version = "0.4.2"
1292source = "registry+https://github.com/rust-lang/crates.io-index"
1293checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
1294
1295[[package]]
1296name = "rand_core"
1297version = "0.5.1" 1243version = "0.5.1"
1298source = "registry+https://github.com/rust-lang/crates.io-index" 1244source = "registry+https://github.com/rust-lang/crates.io-index"
1299checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1245checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
@@ -1329,15 +1275,6 @@ dependencies = [
1329] 1275]
1330 1276
1331[[package]] 1277[[package]]
1332name = "rdrand"
1333version = "0.4.0"
1334source = "registry+https://github.com/rust-lang/crates.io-index"
1335checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
1336dependencies = [
1337 "rand_core 0.3.1",
1338]
1339
1340[[package]]
1341name = "redox_syscall" 1278name = "redox_syscall"
1342version = "0.1.57" 1279version = "0.1.57"
1343source = "registry+https://github.com/rust-lang/crates.io-index" 1280source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 6bae27f..77efd25 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,7 +27,6 @@ sha2 = "0.9.3"
27block-modes = "0.7.0" 27block-modes = "0.7.0"
28aes = "0.6.0" 28aes = "0.6.0"
29askama = "0.10.5" 29askama = "0.10.5"
30libmath = "0.2.1"
31 30
32[dev-dependencies] 31[dev-dependencies]
33serde_test = "1.0.117" 32serde_test = "1.0.117"
diff --git a/src/handlers.rs b/src/handlers.rs
index 8d8b62f..a64c012 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -37,8 +37,6 @@ const TX_UPPER_LIMIT: u16 = 10;
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;
40// Staking reward
41const STAKING_REWARD: f64 = 0.1; // Percentage
42 40
43// Encryption primitive 41// Encryption primitive
44type Aes128Cbc = Cbc<Aes128, Pkcs7>; 42type Aes128Cbc = Cbc<Aes128, Pkcs7>;
@@ -564,7 +562,6 @@ pub async fn propose_block(
564 if let Some(transaction) = pending_transactions.remove(fingerprint) { 562 if let Some(transaction) = pending_transactions.remove(fingerprint) {
565 let source = &transaction.source; 563 let source = &transaction.source;
566 let target = &transaction.target; 564 let target = &transaction.target;
567 let is_source_bot = users_store.get(source).unwrap().is_bot;
568 565
569 if let Some(from) = users_store.get_mut(source) { 566 if let Some(from) = users_store.get_mut(source) {
570 from.balance -= transaction.amount - TX_TRAFFIC_REWARD; 567 from.balance -= transaction.amount - TX_TRAFFIC_REWARD;
@@ -572,12 +569,6 @@ pub async fn propose_block(
572 569
573 if let Some(to) = users_store.get_mut(target) { 570 if let Some(to) = users_store.get_mut(target) {
574 to.balance += transaction.amount; 571 to.balance += transaction.amount;
575 if is_source_bot {
576 // Add staking reward
577 to.balance +=
578 math::round::ceil((f64::from(transaction.amount)) * STAKING_REWARD, 0)
579 as u16;
580 }
581 } 572 }
582 573
583 // if the receiver is a bot, they will reciprocate 574 // if the receiver is a bot, they will reciprocate