32 for (
size_t i = 0; i <
depth; ++i) {
34 current = HashingPolicy::hash_pair(current, current);
38 for (
size_t i = 0; i < initial_size; i++) {
41 leaves.push_back(initial_leaf);
47 for (
size_t i = 0; i < initial_size; ++i) {
64 bool is_already_present;
70 if (!is_already_present) {
75 leaves[current].set(current_leaf);
78 leaves.push_back(new_leaf);
82 auto old_leaf_hash = leaves[current].hash();
83 index_t old_leaf_index = current;
84 auto r = update_element(old_leaf_index, old_leaf_hash);
87 auto new_leaf_hash = new_leaf.
hash();
88 index_t new_leaf_index = is_already_present ? old_leaf_index : leaves.size() - 1;
89 r = update_element(new_leaf_index, new_leaf_hash);
ContentAddressedCachedTreeStore< bb::fr > Store