Skip to content

Commit

Permalink
837 - fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Sep 6, 2023
1 parent 13e9f5b commit 9ccf223
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ void match_nullifiers_to_commitments_and_squash(
match_pos = nullified_commitment == new_commitments[hint_pos] ? hint_pos : match_pos;
}

for (size_t c_idx = 0; c_idx < MAX_NEW_COMMITMENTS_PER_TX; c_idx++) {
// If there are multiple matches, this picks the last one
match_pos = (nullified_commitments[n_idx] == new_commitments[c_idx]) ? c_idx : match_pos;
}

if (match_pos != MAX_NEW_COMMITMENTS_PER_TX) {
// match found!
// squash both the nullifier and the commitment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ TEST_F(native_private_kernel_ordering_tests, native_squash_one_of_one_transient_
previous_kernel.public_inputs.end.new_nullifiers = new_nullifiers;
previous_kernel.public_inputs.end.nullified_commitments = nullifier_commitments;

// Correct nullifier_commitment hint for new_nullifiers[0] == 0 is correct due to the default
// initialization of the array.
PrivateKernelInputsOrdering<NT> private_inputs{ .previous_kernel = previous_kernel };

DummyBuilder builder =
Expand Down Expand Up @@ -254,7 +256,9 @@ TEST_F(native_private_kernel_ordering_tests, native_squash_one_of_two_transient_
previous_kernel.public_inputs.end.new_nullifiers = new_nullifiers;
previous_kernel.public_inputs.end.nullified_commitments = nullifier_commitments;

PrivateKernelInputsOrdering<NT> private_inputs{ .previous_kernel = previous_kernel };
PrivateKernelInputsOrdering<NT> private_inputs{ .previous_kernel = previous_kernel,
.nullifier_commitment_hints =
std::array<fr, MAX_NEW_NULLIFIERS_PER_TX>{ 1 } };

DummyBuilder builder =
DummyBuilder("native_private_kernel_ordering_tests__native_squash_one_of_two_transient_matches_works");
Expand Down Expand Up @@ -289,7 +293,9 @@ TEST_F(native_private_kernel_ordering_tests, native_squash_two_of_two_transient_
previous_kernel.public_inputs.end.new_nullifiers = new_nullifiers;
previous_kernel.public_inputs.end.nullified_commitments = nullifier_commitments;

PrivateKernelInputsOrdering<NT> private_inputs{ .previous_kernel = previous_kernel };
PrivateKernelInputsOrdering<NT> private_inputs{ .previous_kernel = previous_kernel,
.nullifier_commitment_hints =
std::array<fr, MAX_NEW_NULLIFIERS_PER_TX>{ 1 } };

DummyBuilder builder =
DummyBuilder("native_private_kernel_ordering_tests__native_squash_two_of_two_transient_matches_works");
Expand Down

0 comments on commit 9ccf223

Please sign in to comment.