diff options
author | Yigit Sever | 2021-04-14 00:34:39 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-14 00:34:39 +0300 |
commit | 54e81adac6a24291e2ee16cf5597f127122f62eb (patch) | |
tree | d0a031ecf550fe3ee0dc3fead8171686d6f48cb0 /src/validators.rs | |
parent | 61378ccfcc0993744f110db89b0fea52545c1ce6 (diff) | |
download | gradecoin-54e81adac6a24291e2ee16cf5597f127122f62eb.tar.gz gradecoin-54e81adac6a24291e2ee16cf5597f127122f62eb.tar.bz2 gradecoin-54e81adac6a24291e2ee16cf5597f127122f62eb.zip |
Add empty block test
Diffstat (limited to 'src/validators.rs')
-rw-r--r-- | src/validators.rs | 6 |
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 | ||
3 | use log::error; | 3 | use log::error; |
4 | use serde::de::{Deserializer, Error as DeserializerError, Unexpected}; | 4 | use serde::de::{Deserializer, Error as DeserializerError, Unexpected}; |
5 | use serde::ser::{Error as SerializerError, Serializer}; | 5 | use serde::ser::{Error as SerializerError, Serializer}; |
6 | use serde::Deserialize; | 6 | use serde::Deserialize; |
7 | 7 | ||
8 | pub mod validate_game_rating { | 8 | pub 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 |