message: [accumulator] remove unused method:append_one and compute_root_hash
diff: @@ -636,89 +636,6 @@ impl MerkleAccumulator {
  node_store: node_store.clone(),
  })
  }
  -
  - /// Appends one leaf. This will update `frozen_subtree_roots` to store new frozen root nodes
  - /// and remove old nodes if they are now part of a larger frozen subtree.
  - fn _append_one(
  - &self,
  - frozen_subtree_roots: &mut Vec<HashValue>,
  - num_existing_leaves: LeafCount,
  - num_nodes: u64,
  - leaf: HashValue,
  - ) -> u64 {
  - // First just append the leaf.
  - frozen_subtree_roots.push(leaf);
  - // Next, merge the last two subtrees into one. If `num_existing_leaves` has N trailing
  - // ones, the carry will happen N times.
  - let num_trailing_ones = (!num_existing_leaves).trailing_zeros();
  - let mut num_internal_nodes = 0u64;
  - let cache = self.cache.lock().unwrap();
  - for i in 0..num_trailing_ones {
  - let right_hash = frozen_subtree_roots.pop().expect("Invalid accumulator.");
  - let left_hash = frozen_subtree_roots.pop().expect("Invalid accumulator.");
  - let parent_index = NodeIndex::new(num_nodes + i as u64);
  - let parent_node = AccumulatorNode::new_internal(parent_index, left_hash, right_hash);
  - frozen_subtree_roots.push(parent_node.hash());
  - cache
  - .save_index_and_node(parent_index, parent_node.hash(), parent_node)
  - .unwrap();
  - num_internal_nodes += 1;
  - }
  - //save current leaf node
  - let leaf_index = NodeIndex::new(num_nodes + num_trailing_ones as u64);
  - let leaf_node = AccumulatorNode::new_leaf(leaf_index, leaf);
  - cache
  - .save_index_and_node(leaf_index, leaf, leaf_node)
  - .unwrap();
  -
  - num_internal_nodes
  - }
  -
  - /// Computes the root hash of an accumulator given the frozen subtree roots and the number of
  - /// leaves in this accumulator.
  - fn compute_root_hash(
  - frozen_subtree_roots: &[HashValue],
  - num_leaves: LeafCount,
  - ) -> Result<(HashValue, Vec<HashValue>)> {
  - let mut hash_vec = vec![];
  - match frozen_subtree_roots.len() {
  - 0 => return Ok((*ACCUMULATOR_PLACEHOLDER_HASH, hash_vec)),
  - 1 => {
  - hash_vec.push(frozen_subtree_roots[0]);
  - return Ok((frozen_subtree_roots[0], hash_vec));
  - }
  - _ => (),
  - }
  -
  - // The trailing zeros do not matter since anything below the lowest frozen subtree is
  - // already represented by the subtree roots.
  - let mut bitmap = num_leaves >> num_leaves.trailing_zeros();
  - let mut current_hash = *ACCUMULATOR_PLACEHOLDER_HASH;
  - let mut frozen_subtree_iter = frozen_subtree_roots.iter().rev();
  - let mut index = 0u64;
  -
  - while bitmap > 0 {
  - let node_index = NodeIndex::new(index);
  - current_hash = if bitmap & 1 != 0 {
  - InternalNode::new(
  - node_index,
  - *frozen_subtree_iter
  - .next()
  - .expect("This frozen subtree should exist."),
  - current_hash,
  - )
  - } else {
  - InternalNode::new(node_index, current_hash, *ACCUMULATOR_PLACEHOLDER_HASH)
  - }
  - .hash();
  - hash_vec.push(current_hash);
  - println!("insert :{:?}", current_hash.short_str());
  - bitmap >>= 1;
  - index += 1;
  - }
  -
  - Ok((current_hash, hash_vec))
  - }
  }
  impl Accumulator for MerkleAccumulator {
  