pub fn check(&self, old_root: &Cell) -> Result<HashMap<UInt256, Cell>> {

        // check that hash of `old_tree` is equal old hash from `self`
        if self.old_hash != old_root.repr_hash() {
            fail!(BlockError::WrongMerkleUpdate("old bag's hash mismatch".to_string()))
        }

        // traversal along `self.new` and check all pruned branches,
        // all new tree's pruned branches have to be contained in old one
        let mut known_cells = HashSet::new();
        Self::traverse_old_on_check(&self.old, &mut known_cells, &mut HashSet::new(), 0);
        Self::traverse_new_on_check(&self.new, &known_cells, &mut HashSet::new(), 0)?;

        let mut known_cells_vals = HashMap::new();
        Self::collate_old_cells(old_root, &known_cells, &mut known_cells_vals, &mut HashSet::new(), 0);

        Ok(known_cells_vals)
    }
/// Check the update corresponds given bag.
/// The function is called from `apply_for`
Check the update corresponds given bag.
The function is called from `apply_for`
Check the update corresponds given bag . The function is called from ` apply_for `
pub fn check(&self, old_root: &Cell) -> Result<HashMap<UInt256, Cell>> {
        // check that hash of `old_tree` is equal old hash from `self`
        if self.old_hash != old_root.repr_hash() {
            fail!(BlockError::WrongMerkleUpdate("old bag's hash mismatch".to_string()))
        }
        // traversal along `self.new` and check all pruned branches,
        // all new tree's pruned branches have to be contained in old one
        let mut known_cells = HashSet::new();
        Self::traverse_old_on_check(&self.old, &mut known_cells, &mut HashSet::new(), 0);
        Self::traverse_new_on_check(&self.new, &known_cells, &mut HashSet::new(), 0)?;
        let mut known_cells_vals = HashMap::new();
        Self::collate_old_cells(old_root, &known_cells, &mut known_cells_vals, &mut HashSet::new(), 0);
        Ok(known_cells_vals)
    }
pub fn check ( & self , old_root : & Cell ) -> Result < HashMap < UInt256 , Cell > > { // check that hash of `old_tree` is equal old hash from `self` if self . old_hash != old_root . repr_hash ( ) { fail ! ( BlockError WrongMerkleUpdate ( " " to_string ( ) ) ) } // traversal along `self.new` and check all pruned branches, // all new tree's pruned branches have to be contained in old one let mut known_cells = HashSet :: new ( ) ; Self :: traverse_old_on_check ( & self . old , & mut known_cells , & mut HashSet :: new ( ) , 0 ) ; Self :: traverse_new_on_check ( & self . new , & known_cells , & mut HashSet :: new ( ) , 0 ) ? ; let mut known_cells_vals = HashMap :: new ( ) ; Self :: collate_old_cells ( old_root , & known_cells , & mut known_cells_vals , & mut HashSet :: new ( ) , 0 ) ; Ok ( known_cells_vals ) }
Check the update corresponds given bag.
Check the update corresponds given bag .
&self
old_root
&Cell
&self
old_root
&Cell