From b2b588fe921c6e19a922ca39de924c471a9293ec Mon Sep 17 00:00:00 2001 From: jeanmon Date: Wed, 27 Sep 2023 12:38:08 +0000 Subject: [PATCH] Ressuscitate private kernel tests related to call stack item check --- .../private/native_private_kernel_circuit_init.test.cpp | 7 +++---- .../private/native_private_kernel_circuit_inner.test.cpp | 5 +---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.test.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.test.cpp index d1fecdf6745..5c66b6fc7b4 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_init.test.cpp @@ -117,13 +117,12 @@ TEST_F(native_private_kernel_init_tests, basic_contract_deployment) EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::NO_ERROR); } -// TODO(suyash): Disabled until https://github.com/AztecProtocol/aztec-packages/issues/499 is resolved. -TEST_F(native_private_kernel_init_tests, DISABLED_contract_deployment_call_stack_item_hash_mismatch_fails) +TEST_F(native_private_kernel_init_tests, contract_deployment_call_stack_item_hash_mismatch_fails) { auto private_inputs = do_private_call_get_kernel_inputs_init(true, constructor, standard_test_args()); - // Randomise the second item in the private call stack (i.e. hash of the private call item). - private_inputs.private_call.call_stack_item.public_inputs.private_call_stack[1] = NT::fr::random_element(); + // Randomise the first item in the private call stack (i.e. hash of the private call item). + private_inputs.private_call.call_stack_item.public_inputs.private_call_stack[0] = NT::fr::random_element(); DummyBuilder builder = DummyBuilder("private_kernel_tests__contract_deployment_call_stack_item_hash_mismatch_fails"); diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp index bd5865a2f9e..91372b05f09 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp @@ -189,8 +189,7 @@ TEST_F(native_private_kernel_inner_tests, private_function_incorrect_function_le "computed_contract_tree_root doesn't match purported_contract_tree_root"); } -// TODO(suyash): Disabled until https://github.com/AztecProtocol/aztec-packages/issues/499 is resolved. -TEST_F(native_private_kernel_inner_tests, DISABLED_private_function_incorrect_call_stack_item_hash_fails) +TEST_F(native_private_kernel_inner_tests, private_function_incorrect_call_stack_item_hash_fails) { auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); @@ -205,8 +204,6 @@ TEST_F(native_private_kernel_inner_tests, DISABLED_private_function_incorrect_ca EXPECT_TRUE(builder.failed()); EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::PRIVATE_KERNEL__CALCULATED_PRIVATE_CALL_HASH_AND_PROVIDED_PRIVATE_CALL_HASH_MISMATCH); - EXPECT_EQ(builder.get_first_failure().message, - "calculated private_call_hash does not match provided private_call_hash at the top of the call stack"); } TEST_F(native_private_kernel_inner_tests, private_kernel_should_fail_if_aggregating_too_many_commitments)