From e400803cbe0937760e70690d6b310c82d3415586 Mon Sep 17 00:00:00 2001 From: Magamedrasul Ibragimov Date: Sat, 29 Oct 2022 13:45:25 +0300 Subject: [PATCH] style: add new lines to hasher & database modules --- src/database.rs | 4 ++++ src/hasher.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/database.rs b/src/database.rs index 833eeff..1aefb45 100644 --- a/src/database.rs +++ b/src/database.rs @@ -4,12 +4,16 @@ use crate::*; pub trait Database { /// Creates new instance of db fn new(dbpath: &str) -> Self; + /// Loades existing db (existence check required) fn load(dbpath: &str) -> Self; + /// Returns value from db by the key fn get(&self, key: DBKey) -> Result>; + /// Puts the value to the db by the key fn put(&mut self, key: DBKey, value: Value) -> Result<()>; + /// Deletes the key from db fn delete(&mut self, key: DBKey) -> Result<()>; } diff --git a/src/hasher.rs b/src/hasher.rs index 2cc08cb..4368e91 100644 --- a/src/hasher.rs +++ b/src/hasher.rs @@ -7,8 +7,10 @@ pub trait Hasher { /// Creates new hash-function instance fn new() -> Self; + /// Outputs the default leaf (Fr::default()) fn default_leaf() -> Self::Fr; + /// Calculates hash-function fn hash(input: &[Self::Fr]) -> Self::Fr; }