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

Struct ViewPrivateOptions

pub struct ViewPrivateOptions<let S: u32, let T: u32>
{ /* private fields */ }

Configuration for TestEnvironment::view_private_opts.

Constructed by calling ViewPrivateOptions::new and then chaining methods setting each value:

env.view_private_opts(from, ViewPrivateOptions::new().with_additional_scopes([other]), call);

Implementations

impl<let S: u32, let T: u32> ViewPrivateOptions<S, T>

pub fn with_additional_scopes<let S2: u32>( self, additional_scopes: [AztecAddress; S2], ) -> ViewPrivateOptions<S2, T>

Grants access to secrets of additional accounts.

By default only the secrets that belong to the from account can be accessed: this function lets contracts retrieve private information from other accounts during execution.

Example usage includes accounts querying an escrow's balance, which may require accessing the escrow's own notes.

pub fn with_authorized_utility_call_targets<let T_2: u32>( self, targets: [AztecAddress; T_2], ) -> ViewPrivateOptions<S, T_2>

Authorizes cross-contract utility calls to the given target contracts during this call.

By default, cross-contract utility calls are denied. This method lets the test author specify which target contracts are allowed to be called via utility functions during execution.

impl ViewPrivateOptions<0, 0>

pub fn new() -> Self

Creates default ViewPrivateOptions.

The default values are the same as if using TestEnvironment::view_private instead of TestEnvironment::view_private_opts.