Skip to content

Commit

Permalink
Fix tree index type in test util
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Apr 27, 2023
1 parent 354536d commit 21ffc83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions circuits/cpp/src/aztec3/circuits/rollup/test_utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ BaseRollupInputs base_rollup_inputs_from_kernels(std::array<KernelData, 2> kerne
// Update public data tree to generate sibling paths: we first set the initial public data tree to the result of all
// state reads and old_values from state transitions. Note that, if the right tx reads or writes an index that was
// already processed by the left one, we don't want to reflect that as part of the initial state, so we skip those.
std::set<size_t> visited_indices;
std::set<uint256_t> visited_indices;
for (size_t i = 0; i < 2; i++) {
for (auto state_read : kernel_data[i].public_inputs.end.state_reads) {
auto leaf_index = size_t(uint256_t(state_read.leaf_index));
auto leaf_index = uint256_t(state_read.leaf_index);
if (state_read.is_empty() || visited_indices.contains(leaf_index))
continue;
visited_indices.insert(leaf_index);
public_data_tree.update_element(leaf_index, state_read.value);
}

for (auto state_write : kernel_data[i].public_inputs.end.state_transitions) {
auto leaf_index = size_t(uint256_t(state_write.leaf_index));
auto leaf_index = uint256_t(state_write.leaf_index);
if (state_write.is_empty() || visited_indices.contains(leaf_index))
continue;
visited_indices.insert(leaf_index);
Expand Down

0 comments on commit 21ffc83

Please sign in to comment.