Skip to content

Commit

Permalink
Prune no-public-constructor checks from kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Mar 4, 2024
1 parent 5c67427 commit 602797d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ pub fn validate_inputs(public_call: PublicCallData) {
!this_call_stack_item.contract_address.eq(AztecAddress::zero()), "Contract address cannot be zero"
);
assert(this_call_stack_item.function_data.selector.to_field() != 0, "Function signature cannot be zero");
assert(
this_call_stack_item.function_data.is_constructor == false, "Constructors cannot be public functions"
);
assert(
this_call_stack_item.function_data.is_private == false, "Cannot execute a private function with the public kernel circuit"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,6 @@ mod tests {
// assert_eq_public_data_update_requests(public_inputs.end.public_data_update_requests, expected);
// }

#[test(should_fail_with="Constructors cannot be public functions")]
fn constructor_should_fail() {
let mut builder = PublicKernelSetupCircuitPrivateInputsBuilder::new();
builder.public_call.function_data.is_constructor = true;

builder.failed();
}

#[test(should_fail_with="Contract deployment cannot be a public function")]
fn constructor_should_fail_2() {
let mut builder = PublicKernelSetupCircuitPrivateInputsBuilder::new();
builder.public_call.public_inputs.call_context.is_contract_deployment = true;

builder.failed();
}

#[test(should_fail_with="Bytecode hash cannot be zero")]
fn no_bytecode_hash_should_fail() {
let mut builder = PublicKernelSetupCircuitPrivateInputsBuilder::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,6 @@ mod tests {
}
}

#[test(should_fail_with="Constructors cannot be public functions")]
fn constructor_should_fail() {
let mut builder = PublicKernelTeardownCircuitPrivateInputsBuilder::new();
builder.public_call.function_data.is_constructor = true;

builder.failed();
}

#[test(should_fail_with="Contract deployment cannot be a public function")]
fn constructor_should_fail_2() {
let mut builder = PublicKernelTeardownCircuitPrivateInputsBuilder::new();
builder.public_call.public_inputs.call_context.is_contract_deployment = true;

builder.failed();
}

#[test(should_fail_with="Bytecode hash cannot be zero")]
fn no_bytecode_hash_should_fail() {
let mut builder = PublicKernelTeardownCircuitPrivateInputsBuilder::new();
Expand Down

0 comments on commit 602797d

Please sign in to comment.