pub fn witness(&self) -> MerkleWitness {
        let mut filler = self.filler();
        let mut path = vec![];

        // Obtain leaf witness
        match (self.tree.left, self.tree.right) {
            (Some(witness), Some(_)) => path.push((witness, true)),
            (Some(_), _) => path.push((filler.next(0, &self.tree), false)),
            _ => unreachable!(),
        }

        // Update path till depth that is filled in the underlying tree
        for (parent, i) in self.tree.parents.iter().zip(1..) {
            path.push(match parent {
                Some(p) => (*p, true),
                None => (filler.next(i, &self.tree), false),
            });
        }

        // Update path till the root is found
        for i in (self.tree.parents.len() + 1)..self.tree.depth {
            path.push((filler.next(i, &self.tree), false));
        }

        MerkleWitness::from_incremental_witness(path, self.position())
    }
/// Compute the witness to the most recently added commitment to `tree`, taking later additions
/// into account
Compute the witness to the most recently added commitment to `tree`, taking later additions
into account
Compute the witness to the most recently added commitment to ` tree ` taking later additions into account
pub fn witness(&self) -> MerkleWitness {
        let mut filler = self.filler();
        let mut path = vec![];
        // Obtain leaf witness
        match (self.tree.left, self.tree.right) {
            (Some(witness), Some(_)) => path.push((witness, true)),
            (Some(_), _) => path.push((filler.next(0, &self.tree), false)),
            _ => unreachable!(),
        }
        // Update path till depth that is filled in the underlying tree
        for (parent, i) in self.tree.parents.iter().zip(1..) {
            path.push(match parent {
                Some(p) => (*p, true),
                None => (filler.next(i, &self.tree), false),
            });
        }
        // Update path till the root is found
        for i in (self.tree.parents.len() + 1)..self.tree.depth {
            path.push((filler.next(i, &self.tree), false));
        }
        MerkleWitness::from_incremental_witness(path, self.position())
    }
pub fn witness ( & self ) -> MerkleWitness { let mut filler = self . filler ( ) ; let mut path = vec ! [ ] ; // Obtain leaf witness match ( self . tree . left , self . tree . right ) { ( Some ( witness ) , Some ( _ ) ) => path . push ( ( witness , true ) ) , ( Some ( _ ) , _ ) => path . push ( ( filler . next ( 0 , & self . tree ) , false ) ) , _ => unreachable ! ( ) , } // Update path till depth that is filled in the underlying tree for ( parent , i ) in self . tree . parents . iter ( ) . zip ( 1 .. ) { path . push ( match parent { Some ( p ) => ( * p , true ) , None => ( filler . next ( i , & self . tree ) , false ) , } ) ; } // Update path till the root is found for i in ( self . tree . parents . len ( ) + 1 ) .. self . tree . depth { path . push ( ( filler . next ( i , & self . tree ) , false ) ) ; } MerkleWitness :: from_incremental_witness ( path , self . position ( ) ) }
Compute the witness to the most recently added commitment to `tree`, taking later additions
into account
Compute the witness to the most recently added commitment to ` tree ` taking later additions into account
&self
&self