For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::test::helpers::test_environment

Struct TestEnvironmentOptions

pub struct TestEnvironmentOptions
{ /* private fields */ }

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

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

Implementations

impl TestEnvironmentOptions

pub fn new() -> Self

Creates a new TestEnvironmentOptions with default values.

pub fn with_default_tag_secret_strategy<M>( &mut self, mode: M, strategy: TaggingSecretStrategy, ) -> Self

Sets the default TaggingSecretStrategy the wallet reports for mode through the resolve_tagging_strategy 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, the strategy a PXE resolveTaggingSecretStrategy hook typically hardcodes for modes it does not customize.

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 to configure a single mode.

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 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.