1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub struct MerkleTree<L> {
    pub leaves: Vec<L>,
}

pub trait MerkleSpecification {
    type Data;
    type Hash;
    type Leaf;
    type Node;

    fn generate(&self) -> Self;
    fn create_leaf(&self, data: Self::Data) -> Self::Leaf;
}

pub trait LeafSpec {
    type Data;
}