aztec-nr - noir_aztec::test::helpers::test_environment

Struct PrivateContextOptions

pub struct PrivateContextOptions
{ /* private fields */ }

Configuration values for TestEnvironment::private_context_opts. Meant to be used by calling new and then chaining methods setting each value, e.g.:

env.private_context_opts(PrivateContextOptions::new().at_anchor_block_number(5), ...);

Implementations

impl PrivateContextOptions

pub fn new() -> Self

Creates a new PrivateContextOptions with default values, i.e. the same as if using the private_context method instead of private_context_opts. Use the at_anchor_block_number and other methods to set the desired configuration values.

pub fn at_anchor_block_number(&mut self, anchor_block_number: u32) -> Self

Sets the desired anchor block number to base the private context in. Only past block numbers can be specified.

If not set, defaults to the last block number.

pub fn at_contract_address(&mut self, contract_address: AztecAddress) -> Self

Sets the contract address in which the private context will execute, which will affect note and nullifier siloing, storage access, etc.