pub fn generate_proof(&mut self) -> SerializedAdProof {
        self.base.changed_nodes_buffer.clear();
        self.base.changed_nodes_buffer_to_check.clear();
        let mut packaged_tree = BytesMut::new();
        let mut previous_leaf_available = false;
        self.pack_tree(
            &self.old_top_node.as_ref().unwrap().clone(),
            &mut packaged_tree,
            &mut previous_leaf_available,
        );
        packaged_tree.put_u8(END_OF_TREE_IN_PACKAGED_PROOF);
        packaged_tree.extend_from_slice(&self.directions);

        // prepare for the next time proof
        self.base.tree.reset();
        self.directions = Vec::new();
        self.directions_bit_length = 0;
        self.old_top_node = self.base.tree.root.clone();

        packaged_tree.freeze()
    }
///
/// Generates the proof for all the operations performed (except the ones that failed)
/// since the last generateProof call
///
/// @return - the proof
///
Generates the proof for all the operations performed (except the ones that failed)
since the last generateProof call
Generates the proof for all the operations performed ( except the ones that failed ) since the last generateProof call
pub fn generate_proof(&mut self) -> SerializedAdProof {
        self.base.changed_nodes_buffer.clear();
        self.base.changed_nodes_buffer_to_check.clear();
        let mut packaged_tree = BytesMut::new();
        let mut previous_leaf_available = false;
        self.pack_tree(
            &self.old_top_node.as_ref().unwrap().clone(),
            &mut packaged_tree,
            &mut previous_leaf_available,
        );
        packaged_tree.put_u8(END_OF_TREE_IN_PACKAGED_PROOF);
        packaged_tree.extend_from_slice(&self.directions);
        // prepare for the next time proof
        self.base.tree.reset();
        self.directions = Vec::new();
        self.directions_bit_length = 0;
        self.old_top_node = self.base.tree.root.clone();
        packaged_tree.freeze()
    }
pub fn generate_proof ( & mut self ) -> SerializedAdProof { self . base . changed_nodes_buffer . clear ( ) ; self . base . changed_nodes_buffer_to_check . clear ( ) ; let mut packaged_tree = BytesMut :: new ( ) ; let mut previous_leaf_available = false ; self . pack_tree ( & self . old_top_node . as_ref ( ) . unwrap ( ) . clone ( ) , & mut packaged_tree , & mut previous_leaf_available , ) ; packaged_tree . put_u8 ( END_OF_TREE_IN_PACKAGED_PROOF ) ; packaged_tree . extend_from_slice ( & self . directions ) ; // prepare for the next time proof self . base . tree . reset ( ) ; self . directions = Vec :: new ( ) ; self . directions_bit_length = 0 ; self . old_top_node = self . base . tree . root . clone ( ) ; packaged_tree . freeze ( ) }
Generates the proof for all the operations performed (except the ones that failed)
since the last generateProof call
Generates the proof for all the operations performed ( except the ones that failed ) since the last generateProof call
&mut self
None
&mut self