arnaucube
arnaucube/merkletree-rsPublic Self-hosted repository
merkletree-rs/src/lib.rs
src/lib.rsRaw
 1use std::collections::HashMap;
 2
 3#[macro_use]
 4extern crate arrayref;
 5
 6extern crate tiny_keccak;
 7
 8extern crate rustc_hex;
 9
10mod utils;
11mod node;
12
13// const TYPENODEROOT: u8 = 4;
14const EMPTYNODEVALUE: [u8;32] = [0;32];
15
16pub struct TestValue {
17   bytes: Vec<u8>,
18   index_length: u32,
19}
20pub trait Value {
21   fn bytes(&self) -> &Vec<u8>;
22   fn index_length(&self) -> u32;
23}
24impl Value for TestValue {
25   fn bytes(&self) -> &Vec<u8> {
26      &self.bytes
27   }
28   fn index_length(&self) -> u32 {
29      self.index_length
30   }
31}
32