pub fn prove(&self, index: usize) -> Result<Proof, ProverError> {
        if index > u32::MAX as usize {
            return Err(ProverError::IndexTooHigh(index));
        }
        let count = self.count();
        if index >= count {
            return Err(ProverError::ZeroProof { index, count });
        }

        let (leaf, hashes) = self.tree.generate_proof(index, TREE_DEPTH);
        let mut path = [H256::zero(); 32];
        path.copy_from_slice(&hashes[..32]);
        Ok(Proof { leaf, index, path })
    }
/// Create a proof of a leaf in this tree.
///
/// Note, if the tree ingests more leaves, the root will need to be recalculated.
Create a proof of a leaf in this tree.
Note, if the tree ingests more leaves, the root will need to be recalculated.
Create a proof of a leaf in this tree . Note if the tree ingests more leaves the root will need to be recalculated .
pub fn prove(&self, index: usize) -> Result<Proof, ProverError> {
        if index > u32::MAX as usize {
            return Err(ProverError::IndexTooHigh(index));
        }
        let count = self.count();
        if index >= count {
            return Err(ProverError::ZeroProof { index, count });
        }
        let (leaf, hashes) = self.tree.generate_proof(index, TREE_DEPTH);
        let mut path = [H256::zero(); 32];
        path.copy_from_slice(&hashes[..32]);
        Ok(Proof { leaf, index, path })
    }
pub fn prove ( & self , index : usize ) -> Result < Proof , ProverError > { if index > u32 :: MAX as usize { return Err ( ProverError :: IndexTooHigh ( index ) ) ; } let count = self . count ( ) ; if index >= count { return Err ( ProverError :: ZeroProof { index , count } ) ; } let ( leaf , hashes ) = self . tree . generate_proof ( index , TREE_DEPTH ) ; let mut path = [ H256 :: zero ( ) ; 32 ] ; path . copy_from_slice ( & hashes [ .. 32 ] ) ; Ok ( Proof { leaf , index , path } ) }
Create a proof of a leaf in this tree.
Create a proof of a leaf in this tree .
&self
index
usize
&self
index
usize