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

# Struct ExecuteUtilityOptions

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

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

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

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

```rust
env.execute_utility_opts(
    ExecuteUtilityOptions::new().with_from(caller).with_authorized_utility_call_targets([target]),
    SomeContract::at(addr).some_utility_function(),
);
```

## Implementations

```rust
impl ExecuteUtilityOptions<0>
```

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

Creates default `ExecuteUtilityOptions`.

```rust
impl<let T: u32> ExecuteUtilityOptions<T>
```

```rust
pub fn with_from(&mut self, from: AztecAddress) -> Self
```

Sets the `msg_sender` simulating a cross-contract call.

By default, an `Option::none` value is supplied to `maybe_msg_sender`.

```rust
pub fn with_authorized_utility_call_targets<let T_2: u32>(
    self,
    targets: [AztecAddress; T_2],
) -> ExecuteUtilityOptions<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.
