Trait storage_proofs_core::merkle::MerkleTreeTrait
source · [−]pub trait MerkleTreeTrait: Send + Sync + Debug {
type Arity: 'static + PoseidonArity;
type SubTreeArity: 'static + PoseidonArity;
type TopTreeArity: 'static + PoseidonArity;
type Hasher: 'static + Hasher;
type Store: Store<<Self::Hasher as Hasher>::Domain>;
type Proof: MerkleProofTrait<Hasher = Self::Hasher, Arity = Self::Arity, SubTreeArity = Self::SubTreeArity, TopTreeArity = Self::TopTreeArity>;
fn display() -> String;
fn root(&self) -> <Self::Hasher as Hasher>::Domain;
fn gen_proof(&self, index: usize) -> Result<Self::Proof>;
fn gen_cached_proof(
&self,
i: usize,
rows_to_discard: Option<usize>
) -> Result<Self::Proof>;
fn row_count(&self) -> usize;
fn leaves(&self) -> usize;
fn from_merkle(
tree: MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function, Self::Store, Self::Arity, Self::SubTreeArity, Self::TopTreeArity>
) -> Self;
}
Expand description
Trait used to abstract over the way Merkle Trees are constructed and stored.
Associated Types
type Arity: 'static + PoseidonArity
type SubTreeArity: 'static + PoseidonArity
type TopTreeArity: 'static + PoseidonArity
type Proof: MerkleProofTrait<Hasher = Self::Hasher, Arity = Self::Arity, SubTreeArity = Self::SubTreeArity, TopTreeArity = Self::TopTreeArity>
Required methods
Creates a merkle proof of the node at the given index.