diff --git a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr index dc6b15ccf087..4ca9fbfe1a29 100644 --- a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/main.nr @@ -1,11 +1,15 @@ // A demonstration of inclusion and non-inclusion proofs. use dep::aztec::macros::aztec; -mod test; +// mod test; #[aztec] pub contract InclusionProofs { use dep::aztec::encrypted_logs::log_assembly_strategies::default_aes128::note::encode_and_encrypt_note; + use dep::aztec::{ + oracle::execution::get_contract_address, + test::helpers::{cheatcodes, test_environment::TestEnvironment}, + }; use dep::aztec::prelude::{AztecAddress, Map, NoteGetterOptions, PrivateSet, PublicMutable}; use dep::aztec::{ @@ -15,262 +19,17 @@ pub contract InclusionProofs { // docs:start:value_note_imports use dep::value_note::value_note::ValueNote; // docs:end:value_note_imports - #[storage] - struct Storage { - private_values: Map, Context>, - public_value: PublicMutable, - public_unused_value: PublicMutable, - } - - #[public] - #[initializer] - fn constructor(public_value: Field) { - storage.public_value.write(public_value); - } - - // docs:start:create_note - // Creates a value note owned by `owner`. - #[private] - fn create_note(owner: AztecAddress, value: Field) { - let mut note = ValueNote::new(value, owner); - - storage.private_values.at(owner).insert(&mut note).emit(encode_and_encrypt_note( - &mut context, - owner, - context.msg_sender(), - )); - } - // docs:end:create_note - - unconstrained fn get_note(owner: AztecAddress) -> ValueNote { - let options = NoteViewerOptions::new().set_limit(1); - let note = storage.private_values.at(owner).view_notes(options).get(0); - - note - } - - #[private] - fn test_note_inclusion( - owner: AztecAddress, - use_block_number: bool, - block_number: u32, // The block at which we'll prove that the note exists - nullified: bool, - ) { - // docs:start:get_note_from_pxe - // 1) Get the note from PXE. - let private_values = storage.private_values.at(owner); - let mut options = NoteGetterOptions::new(); - options = options.set_limit(1); - if (nullified) { - options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); - } - let note = private_values.get_notes(options).get(0); - // docs:end:get_note_from_pxe - // docs:start:prove_note_inclusion - // 2) Prove the note inclusion - let header = if (use_block_number) { - context.get_block_header_at(block_number) - } else { - context.get_block_header() - }; - - header.prove_note_inclusion(note); - // docs:end:prove_note_inclusion - } - - #[private] - fn test_note_inclusion_fail_case( - owner: AztecAddress, - use_block_number: bool, - block_number: u32, // The block at which we'll prove that the note exists - ) { - let header = context.get_block_header(); - let mut note = ValueNote::new(1, owner); - - let header = if (use_block_number) { - context.get_block_header_at(block_number) - } else { - context.get_block_header() - }; - - header.prove_note_inclusion(note); - } - - // Proves that the note was not yet nullified at block `block_number`. - #[private] - fn test_note_not_nullified( - owner: AztecAddress, - use_block_number: bool, - block_number: u32, // The block at which we'll prove that the nullifier does not exists - // Value below is only used when the note is not found --> used to test the nullifier non-inclusion failure - // case (it allows me to pass in random value of note nullifier - I cannot add and fetch a random note from PXE - // because PXE performs note commitment inclusion check when you add a new note). - fail_case: bool, - ) { - // 1) Get the note from PXE - let private_values = storage.private_values.at(owner); - let mut options = NoteGetterOptions::new(); - options = options.set_limit(1); - if (fail_case) { - options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); - } - let note = private_values.get_notes(options).get(0); - - let header = if (use_block_number) { - context.get_block_header_at(block_number) - } else { - context.get_block_header() - }; - // docs:start:prove_note_not_nullified - header.prove_note_not_nullified(note, &mut context); - // docs:end:prove_note_not_nullified - } - - #[private] - fn test_note_validity( - owner: AztecAddress, - use_block_number: bool, - block_number: u32, // The block at which we'll prove that the note exists and is not nullified - nullified: bool, - ) { - // 1) Get the note from PXE. - let private_values = storage.private_values.at(owner); - let mut options = NoteGetterOptions::new(); - options = options.set_limit(1); - if (nullified) { - options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); - } - let note = private_values.get_notes(options).get(0); - - // 2) Prove the note validity - let header = if (use_block_number) { - context.get_block_header_at(block_number) - } else { - context.get_block_header() - }; - // docs:start:prove_note_validity - header.prove_note_validity(note, &mut context); - // docs:end:prove_note_validity - } - - // docs:start:nullify_note - #[private] - fn nullify_note(owner: AztecAddress) { - let private_values = storage.private_values.at(owner); - let mut options = NoteGetterOptions::new(); - options = options.set_limit(1); - let notes = private_values.pop_notes(options); - assert(notes.len() == 1, "note not popped"); - } - // docs:end:nullify_note - - // Proves nullifier existed at block `block_number`. - // Note: I am not getting a nullifier of the note that was created in this contract in this function because it is - // currently not possible to obtain a nullified note from PXE. - #[private] - fn test_nullifier_inclusion( - nullifier: Field, - use_block_number: bool, - block_number: u32, // The block at which we'll prove that the nullifier exists in the nullifier tree - ) { - let header = if (use_block_number) { - context.get_block_header_at(block_number) - } else { - context.get_block_header() - }; - // docs:start:prove_nullifier_inclusion - header.prove_nullifier_inclusion(nullifier); - // docs:end:prove_nullifier_inclusion - } - - #[public] - fn push_nullifier_public(nullifier: Field) { - context.push_nullifier(nullifier); - } - // Proves nullifier existed at latest block - #[public] - fn test_nullifier_inclusion_from_public(nullifier: Field) { - assert(context.nullifier_exists(nullifier, context.this_address())); - } - - #[private] - fn test_storage_historical_read_unset_slot( - block_number: u32, // The block at which we'll read the public storage value - ) { - let header = context.get_block_header_at(block_number); - // docs:start:public_storage_historical_read - assert_eq( - header.public_storage_historical_read( - storage.public_unused_value.storage_slot, - context.this_address(), - ), - 0, - ); - // docs:end:public_storage_historical_read - } - - #[private] - fn test_storage_historical_read( - expected: Field, - use_block_number: bool, - block_number: u32, // The block at which we'll read the public storage value - ) { - let header = if (use_block_number) { - context.get_block_header_at(block_number) - } else { - context.get_block_header() - }; - - let actual = header.public_storage_historical_read( - storage.public_value.storage_slot, - context.this_address(), - ); - - assert_eq(actual, expected, "Actual public value does not match expected"); - } - - // Proves that a contract was publicly deployed and/or initialized at block `block_number`. - #[private] - fn test_contract_inclusion( - contract_address: AztecAddress, - block_number: u32, - test_deployment: bool, - test_initialization: bool, - ) { - let header = context.get_block_header_at(block_number); - - if test_deployment { - // docs:start:prove_contract_deployment - header.prove_contract_deployment(contract_address); - // docs:end:prove_contract_deployment - } - if test_initialization { - // docs:start:prove_contract_initialization - header.prove_contract_initialization(contract_address); - // docs:end:prove_contract_initialization - } - } + #[test] + unconstrained fn hello() { + let mut env = TestEnvironment::new(); + let owner = env.create_account(); + env.impersonate(owner); - // Proves that a contract was NOT publicly deployed and/or initialized at block `block_number`. - #[private] - fn test_contract_non_inclusion( - contract_address: AztecAddress, - block_number: u32, - test_deployment: bool, - test_initialization: bool, - ) { - let header = context.get_block_header_at(block_number); + // Advance a block so we know that at block 1 our contract has not been deployed yet. + env.advance_block_by(1); - if test_deployment { - // docs:start:prove_contract_non_deployment - header.prove_contract_non_deployment(contract_address); - // docs:end:prove_contract_non_deployment - } - if test_initialization { - // docs:start:prove_contract_non_initialization - header.prove_contract_non_initialization(contract_address); - // docs:end:prove_contract_non_initialization - } + let inclusion_proofs_contract = env.deploy_self("InclusionProofs").without_initializer(); + let contract_address = inclusion_proofs_contract.to_address(); } } diff --git a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/test.nr b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/test.nr index d8e461a0c3f8..44f9aa52ae2c 100644 --- a/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/test.nr +++ b/noir-projects/noir-contracts/contracts/inclusion_proofs_contract/src/test.nr @@ -1,11 +1,11 @@ -use crate::InclusionProofs; -use dep::aztec::{ - oracle::execution::get_contract_address, - prelude::AztecAddress, - test::helpers::{cheatcodes, test_environment::TestEnvironment}, -}; +// use crate::InclusionProofs; +// use dep::aztec::{ +// oracle::execution::get_contract_address, +// prelude::AztecAddress, +// test::helpers::{cheatcodes, test_environment::TestEnvironment}, +// }; -global INITIAL_VALUE: Field = 69; +// global INITIAL_VALUE: Field = 69; pub unconstrained fn setup( initial_value: Field, @@ -20,324 +20,323 @@ pub unconstrained fn setup( // Deploy contract and initialize let initializer = InclusionProofs::interface().constructor(initial_value); - let inclusion_proofs_contract = - env.deploy_self("InclusionProofs").with_public_void_initializer(initializer); + let inclusion_proofs_contract = env.deploy_self("InclusionProofs").without_initializer(); let contract_address = inclusion_proofs_contract.to_address(); env.advance_block_by(1); (&mut env, contract_address, owner) } -#[test] -unconstrained fn note_flow() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn note_flow() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - let block_number = env.block_number(); +// let block_number = env.block_number(); - let NOTE_VALUE = 69; - InclusionProofs::at(contract_address).create_note(owner, NOTE_VALUE).call(&mut env.private()); +// let NOTE_VALUE = 69; +// InclusionProofs::at(contract_address).create_note(owner, NOTE_VALUE).call(&mut env.private()); - env.advance_block_by(2); +// env.advance_block_by(2); - let current_contract_address = get_contract_address(); - cheatcodes::set_contract_address(contract_address); +// let current_contract_address = get_contract_address(); +// cheatcodes::set_contract_address(contract_address); - let note = InclusionProofs::get_note(owner); - cheatcodes::set_contract_address(current_contract_address); +// let note = InclusionProofs::get_note(owner); +// cheatcodes::set_contract_address(current_contract_address); - assert(note.owner.eq(owner)); - assert(note.value.eq(NOTE_VALUE)); +// assert(note.owner.eq(owner)); +// assert(note.value.eq(NOTE_VALUE)); - InclusionProofs::at(contract_address) - .test_note_inclusion(owner, true, block_number, false) - .call(&mut env.private()); - InclusionProofs::at(contract_address).test_note_inclusion(owner, false, 0, false).call( - &mut env.private(), - ); +// InclusionProofs::at(contract_address) +// .test_note_inclusion(owner, true, block_number, false) +// .call(&mut env.private()); +// InclusionProofs::at(contract_address).test_note_inclusion(owner, false, 0, false).call( +// &mut env.private(), +// ); - InclusionProofs::at(contract_address) - .test_note_not_nullified(owner, true, block_number, false) - .call(&mut env.private()); - InclusionProofs::at(contract_address).test_note_not_nullified(owner, false, 0, false).call( - &mut env.private(), - ); +// InclusionProofs::at(contract_address) +// .test_note_not_nullified(owner, true, block_number, false) +// .call(&mut env.private()); +// InclusionProofs::at(contract_address).test_note_not_nullified(owner, false, 0, false).call( +// &mut env.private(), +// ); - InclusionProofs::at(contract_address).test_note_validity(owner, true, block_number, false).call( - &mut env.private(), - ); - InclusionProofs::at(contract_address).test_note_validity(owner, false, 0, false).call( - &mut env.private(), - ); -} +// InclusionProofs::at(contract_address).test_note_validity(owner, true, block_number, false).call( +// &mut env.private(), +// ); +// InclusionProofs::at(contract_address).test_note_validity(owner, false, 0, false).call( +// &mut env.private(), +// ); +// } -#[test] -unconstrained fn nullify_note_flow() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn nullify_note_flow() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - let note_valid_block_number = env.block_number(); +// let note_valid_block_number = env.block_number(); - InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); +// InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); +// InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address) - .test_note_inclusion(owner, true, note_valid_block_number, true) - .call(&mut env.private()); +// InclusionProofs::at(contract_address) +// .test_note_inclusion(owner, true, note_valid_block_number, true) +// .call(&mut env.private()); - InclusionProofs::at(contract_address).test_note_inclusion(owner, false, 0, true).call( - &mut env.private(), - ); +// InclusionProofs::at(contract_address).test_note_inclusion(owner, false, 0, true).call( +// &mut env.private(), +// ); - InclusionProofs::at(contract_address) - .test_note_not_nullified(owner, true, note_valid_block_number, true) - .call(&mut env.private()); - InclusionProofs::at(contract_address) - .test_note_validity(owner, true, note_valid_block_number, true) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_note_not_nullified(owner, true, note_valid_block_number, true) +// .call(&mut env.private()); +// InclusionProofs::at(contract_address) +// .test_note_validity(owner, true, note_valid_block_number, true) +// .call(&mut env.private()); +// } -#[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] -unconstrained fn note_not_nullified_after_nullified() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] +// unconstrained fn note_not_nullified_after_nullified() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); +// InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); +// InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - // TODO: env.block_number() should actually return the private context inputs block number, not the block that is currently being built ! - // Change env.block_number to subtract one, then just use `env.block_number()`. - InclusionProofs::at(contract_address) - .test_note_not_nullified(owner, true, env.block_number() - 1, true) - .call(&mut env.private()); -} +// // TODO: env.block_number() should actually return the private context inputs block number, not the block that is currently being built ! +// // Change env.block_number to subtract one, then just use `env.block_number()`. +// InclusionProofs::at(contract_address) +// .test_note_not_nullified(owner, true, env.block_number() - 1, true) +// .call(&mut env.private()); +// } -#[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] -unconstrained fn note_not_nullified_after_nullified_no_block_number() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] +// unconstrained fn note_not_nullified_after_nullified_no_block_number() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); +// InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); +// InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).test_note_not_nullified(owner, false, 0, true).call( - &mut env.private(), - ); -} +// InclusionProofs::at(contract_address).test_note_not_nullified(owner, false, 0, true).call( +// &mut env.private(), +// ); +// } -#[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] -unconstrained fn validity_after_nullified() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] +// unconstrained fn validity_after_nullified() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); +// InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); +// InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address) - .test_note_validity(owner, true, env.block_number() - 1, true) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_note_validity(owner, true, env.block_number() - 1, true) +// .call(&mut env.private()); +// } -#[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] -unconstrained fn validity_after_nullified_no_block_number() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "Assertion failed: Proving nullifier non-inclusion failed: low_nullifier.value < nullifier.value check failed")] +// unconstrained fn validity_after_nullified_no_block_number() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); +// InclusionProofs::at(contract_address).create_note(owner, 5).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); +// InclusionProofs::at(contract_address).nullify_note(owner).call(&mut env.private()); - env.advance_block_by(1); +// env.advance_block_by(1); - InclusionProofs::at(contract_address).test_note_validity(owner, false, 0, true).call( - &mut env.private(), - ); -} +// InclusionProofs::at(contract_address).test_note_validity(owner, false, 0, true).call( +// &mut env.private(), +// ); +// } -#[test(should_fail_with = "not found in NOTE_HASH_TREE")] -unconstrained fn note_inclusion_fail_case() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "not found in NOTE_HASH_TREE")] +// unconstrained fn note_inclusion_fail_case() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); - let random_owner = AztecAddress::from_field(dep::aztec::oracle::random::random()); +// env.impersonate(owner); +// let random_owner = AztecAddress::from_field(dep::aztec::oracle::random::random()); - let block_number = env.block_number(); +// let block_number = env.block_number(); - env.advance_block_by(2); +// env.advance_block_by(2); - InclusionProofs::at(contract_address) - .test_note_inclusion_fail_case(random_owner, true, block_number) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_note_inclusion_fail_case(random_owner, true, block_number) +// .call(&mut env.private()); +// } -#[test(should_fail_with = "not found in NOTE_HASH_TREE")] -unconstrained fn note_inclusion_fail_case_no_block_number() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "not found in NOTE_HASH_TREE")] +// unconstrained fn note_inclusion_fail_case_no_block_number() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); - let random_owner = AztecAddress::from_field(dep::aztec::oracle::random::random()); +// env.impersonate(owner); +// let random_owner = AztecAddress::from_field(dep::aztec::oracle::random::random()); - env.advance_block_by(2); +// env.advance_block_by(2); - InclusionProofs::at(contract_address) - .test_note_inclusion_fail_case(random_owner, false, 0) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_note_inclusion_fail_case(random_owner, false, 0) +// .call(&mut env.private()); +// } -#[test] -unconstrained fn nullifier_inclusion() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// #[test] +// unconstrained fn nullifier_inclusion() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); +// env.impersonate(owner); - // first nullifier - let nullifier = 6969 + 1; +// // first nullifier +// let nullifier = 6969 + 1; - InclusionProofs::at(contract_address) - .test_nullifier_inclusion(nullifier, true, env.block_number() - 1) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_nullifier_inclusion(nullifier, true, env.block_number() - 1) +// .call(&mut env.private()); +// } -#[test] -unconstrained fn nullifier_inclusion_no_block_number() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn nullifier_inclusion_no_block_number() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - // first nullifier - let nullifier = 6969 + 1; - env.impersonate(owner); +// // first nullifier +// let nullifier = 6969 + 1; +// env.impersonate(owner); - InclusionProofs::at(contract_address).test_nullifier_inclusion(nullifier, false, 0).call( - &mut env.private(), - ); -} +// InclusionProofs::at(contract_address).test_nullifier_inclusion(nullifier, false, 0).call( +// &mut env.private(), +// ); +// } -#[test] -unconstrained fn nullifier_inclusion_public() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn nullifier_inclusion_public() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - let unsiloed_nullifier = 0xffffff; - InclusionProofs::at(contract_address).push_nullifier_public(unsiloed_nullifier).call( - &mut env.public(), - ); +// let unsiloed_nullifier = 0xffffff; +// InclusionProofs::at(contract_address).push_nullifier_public(unsiloed_nullifier).call( +// &mut env.public(), +// ); - env.advance_block_by(1); - InclusionProofs::at(contract_address) - .test_nullifier_inclusion_from_public(unsiloed_nullifier) - .call(&mut env.public()); -} +// env.advance_block_by(1); +// InclusionProofs::at(contract_address) +// .test_nullifier_inclusion_from_public(unsiloed_nullifier) +// .call(&mut env.public()); +// } -#[test(should_fail_with = "Nullifier witness not found for nullifier")] -unconstrained fn nullifier_non_existence() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "Nullifier witness not found for nullifier")] +// unconstrained fn nullifier_non_existence() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - let block_number = env.block_number() - 1; - env.impersonate(owner); - let random_nullifier = dep::aztec::oracle::random::random(); +// let block_number = env.block_number() - 1; +// env.impersonate(owner); +// let random_nullifier = dep::aztec::oracle::random::random(); - InclusionProofs::at(contract_address) - .test_nullifier_inclusion(random_nullifier, true, block_number) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_nullifier_inclusion(random_nullifier, true, block_number) +// .call(&mut env.private()); +// } -#[test(should_fail_with = "Nullifier witness not found for nullifier")] -unconstrained fn nullifier_non_existence_no_block_number() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test(should_fail_with = "Nullifier witness not found for nullifier")] +// unconstrained fn nullifier_non_existence_no_block_number() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); - let random_nullifier = dep::aztec::oracle::random::random(); +// env.impersonate(owner); +// let random_nullifier = dep::aztec::oracle::random::random(); - InclusionProofs::at(contract_address).test_nullifier_inclusion(random_nullifier, false, 0).call( - &mut env.private(), - ); -} +// InclusionProofs::at(contract_address).test_nullifier_inclusion(random_nullifier, false, 0).call( +// &mut env.private(), +// ); +// } -#[test] -unconstrained fn historical_reads() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn historical_reads() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - let block_number = env.block_number() - 1; +// let block_number = env.block_number() - 1; - InclusionProofs::at(contract_address) - .test_storage_historical_read(INITIAL_VALUE, true, block_number) - .call(&mut env.private()); - InclusionProofs::at(contract_address) - .test_storage_historical_read(INITIAL_VALUE, false, 0) - .call(&mut env.private()); +// InclusionProofs::at(contract_address) +// .test_storage_historical_read(INITIAL_VALUE, true, block_number) +// .call(&mut env.private()); +// InclusionProofs::at(contract_address) +// .test_storage_historical_read(INITIAL_VALUE, false, 0) +// .call(&mut env.private()); - InclusionProofs::at(contract_address).test_storage_historical_read(0, true, 1).call( - &mut env.private(), - ); +// InclusionProofs::at(contract_address).test_storage_historical_read(0, true, 1).call( +// &mut env.private(), +// ); - InclusionProofs::at(contract_address) - .test_storage_historical_read_unset_slot(block_number) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_storage_historical_read_unset_slot(block_number) +// .call(&mut env.private()); +// } -#[test] -unconstrained fn contract_flow() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn contract_flow() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - let block_number = env.block_number() - 1; +// let block_number = env.block_number() - 1; - InclusionProofs::at(contract_address) - .test_contract_inclusion(contract_address, block_number, true, true) - .call(&mut env.private()); +// InclusionProofs::at(contract_address) +// .test_contract_inclusion(contract_address, block_number, true, true) +// .call(&mut env.private()); - InclusionProofs::at(contract_address) - .test_contract_non_inclusion(contract_address, 1, true, true) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_contract_non_inclusion(contract_address, 1, true, true) +// .call(&mut env.private()); +// } -#[test] -unconstrained fn test_contract_not_initialized() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn test_contract_not_initialized() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - InclusionProofs::at(contract_address) - .test_contract_inclusion(contract_address, 1, true, false) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_contract_inclusion(contract_address, 1, true, false) +// .call(&mut env.private()); +// } -#[test] -unconstrained fn test_contract_not_deployed() { - let (env, contract_address, owner) = setup(INITIAL_VALUE); +// #[test] +// unconstrained fn test_contract_not_deployed() { +// let (env, contract_address, owner) = setup(INITIAL_VALUE); - env.impersonate(owner); +// env.impersonate(owner); - InclusionProofs::at(contract_address) - .test_contract_inclusion(contract_address, 1, false, true) - .call(&mut env.private()); -} +// InclusionProofs::at(contract_address) +// .test_contract_inclusion(contract_address, 1, false, true) +// .call(&mut env.private()); +// }