aboutsummaryrefslogtreecommitdiffstats
path: root/src/validators.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-14 00:34:39 +0300
committerYigit Sever2021-04-14 00:34:39 +0300
commitfc9aa0c69b11f6ec93255b984839e0c2418a63cf (patch)
treece51fc4cbf82ec1e375d5cf33a54c4ba4d0b1bbe /src/validators.rs
parentec6bcf166032d0820716189308020c2b2d1faa67 (diff)
downloadgradecoin-fc9aa0c69b11f6ec93255b984839e0c2418a63cf.tar.gz
gradecoin-fc9aa0c69b11f6ec93255b984839e0c2418a63cf.tar.bz2
gradecoin-fc9aa0c69b11f6ec93255b984839e0c2418a63cf.zip
Add empty block test
Diffstat (limited to 'src/validators.rs')
-rw-r--r--src/validators.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validators.rs b/src/validators.rs
index dbebee8..31344d8 100644
--- a/src/validators.rs
+++ b/src/validators.rs
@@ -1,14 +1,14 @@
1// Custom validators incoming data 1/// Custom validators incoming data
2 2
3use log::error; 3use log::error;
4use serde::de::{Deserializer, Error as DeserializerError, Unexpected}; 4use serde::de::{Deserializer, Error as DeserializerError, Unexpected};
5use serde::ser::{Error as SerializerError, Serializer}; 5use serde::ser::{Error as SerializerError, Serializer};
6use serde::Deserialize; 6use serde::Deserialize;
7 7
8pub mod validate_game_rating { 8pub mod validate_block {
9 use super::*; 9 use super::*;
10 10
11 const ERROR_MESSAGE: &str = "rating must be a number between 0 and 100"; 11 const ERROR_MESSAGE: &str = "block cannot have an empty transaction list";
12 12
13 pub fn deserialize<'de, D>(deserializer: D) -> Result<u8, D::Error> 13 pub fn deserialize<'de, D>(deserializer: D) -> Result<u8, D::Error>
14 where 14 where