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

# Struct TestEnvironmentOptions

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

```rust
pub struct TestEnvironmentOptions
{ /* private fields */ }
```

Configuration values for [`TestEnvironment::new_opts`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#new_opts). Meant to be used by calling `new` and then chaining methods setting each value, e.g.:

```rust
let env = TestEnvironment::new_opts(
    TestEnvironmentOptions::new().with_default_tag_secret_strategy(
        MessageDelivery::onchain_unconstrained(),
        TaggingSecretStrategy::non_interactive_handshake(),
    ),
);
```

## Implementations

```rust
impl TestEnvironmentOptions
```

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

Creates a new `TestEnvironmentOptions` with default values.

```rust
pub fn with_default_tag_secret_strategy<M>(
    &mut self,
    mode: M,
    strategy: TaggingSecretStrategy,
) -> Self
where
    M: Into<OnchainDeliveryMode>
```

Sets the default [`TaggingSecretStrategy`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/tagging_secret_strategy/struct.TaggingSecretStrategy.md) the wallet reports for `mode` through the [`resolve_tagging_strategy`](/aztec-nr-api/v6.0.0/noir_aztec/oracle/resolve_tagging_strategy/index.md) oracle, affecting message delivery in private executions that do not fix their own delivery derivation.

If no strategy is set for either mode, the wallet hook is left unconfigured and the private execution environment applies its own default. A mode left unset while the other is configured falls back to the default [`TaggingSecretStrategy::non_interactive_handshake`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/tagging_secret_strategy/struct.TaggingSecretStrategy.md#non_interactive_handshake), the strategy a PXE `resolveTaggingSecretStrategy` hook typically hardcodes for modes it does not customize.

```rust
pub fn with_default_tag_secret_strategy_all_modes(
    &mut self,
    strategy: TaggingSecretStrategy,
) -> Self
```

Sets `strategy` for both delivery modes: the equivalent of a PXE `resolveTaggingSecretStrategy` hook that ignores the request's mode. See [`with_default_tag_secret_strategy`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironmentOptions.md#with_default_tag_secret_strategy) to configure a single mode.

```rust
pub fn with_all_utility_call_targets_authorized(&mut self) -> Self
```

Authorizes all cross-contract utility call targets for the entire test.

Removes the need to list targets on each call via [`CallPrivateOptions::with_authorized_utility_call_targets`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md#with_authorized_utility_call_targets) and its siblings.

By default, cross-contract utility calls are denied, mirroring a wallet that authorizes no such call. Use this in tests that do not care about utility call authorization.
