> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct CallPrivateOptions

Module: `noir_aztec::test::helpers::test_environment`

```rust
pub struct CallPrivateOptions<let N: u32, let T: u32>
{ /* private fields */ }
```

Configuration for [`TestEnvironment::call_private_opts`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#call_private_opts).

Constructed by calling [`CallPrivateOptions::new`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md#new) and then chaining methods setting each value:

```rust
env.call_private_opts(from, CallPrivateOptions::new().with_additional_scopes([other]), call);
```

## Implementations

```rust
impl CallPrivateOptions<0, 0>
```

```rust
pub fn new() -> Self
```

Creates default `CallPrivateOptions`.

The default values are the same as if using [`TestEnvironment::call_private`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#call_private) instead of [`TestEnvironment::call_private_opts`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#call_private_opts).

```rust
impl<let N: u32, let T: u32> CallPrivateOptions<N, T>
```

```rust
pub fn with_additional_scopes<let N_2: u32>(
    self,
    additional_scopes: [AztecAddress; N_2],
) -> CallPrivateOptions<N_2, 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 withdrawing from an escrow, which may require accessing the escrow's own notes and secrets.

```rust
pub fn with_authorized_utility_call_targets<let T_2: u32>(
    self,
    targets: [AztecAddress; T_2],
) -> CallPrivateOptions<N, T_2>
```

Authorizes cross-contract utility calls to given targets.

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.

```rust
pub fn with_gas_limits(self, gas_limits: Gas) -> Self
```

Sets the gas limits for the transaction.

If not set, defaults to the maximum the protocol allows.

```rust
pub fn with_teardown_gas_limits(self, teardown_gas_limits: Gas) -> Self
```

Sets the teardown gas limits for the transaction.

If not set, defaults to 1/8 of the protocol maximum.

```rust
pub fn with_max_fees_per_gas(self, max_fees_per_gas: GasFees) -> Self
```

Sets the maximum fees per gas unit the sender is willing to pay.

If not set, defaults to zero.

```rust
pub fn with_max_priority_fees_per_gas(self, max_priority_fees_per_gas: GasFees) -> Self
```

Sets the maximum priority fees per gas unit.

If not set, defaults to zero.

```rust
pub fn with_gas_settings(self, gas_settings: GasSettings) -> Self
```

Convenience method to set all four gas settings fields at once.

Equivalent to calling [`with_gas_limits`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md#with_gas_limits), [`with_teardown_gas_limits`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md#with_teardown_gas_limits), [`with_max_fees_per_gas`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md#with_max_fees_per_gas), and [`with_max_priority_fees_per_gas`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md#with_max_priority_fees_per_gas) individually.
