style: add new lines to hasher & database modules

This commit is contained in:
Magamedrasul Ibragimov 2022-10-29 13:45:25 +03:00
parent e650af8ee4
commit e400803cbe
2 changed files with 6 additions and 0 deletions

View File

@ -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<Option<Value>>;
/// 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<()>;
}

View File

@ -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;
}