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

Module test_environment

Structs

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

    env.call_public_opts(caller, CallPublicOptions::new().with_max_fees_per_gas(GasFees::new(1, 1)),
    MyContract::at(addr).fn());

    Gas settings fields are not cross-validated - nonsense combinations (e.g. teardown_gas_limits larger than gas_limits) will be forwarded as-is and may be rejected by simulation.

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

    env.create_light_account_opts(CreateAccountOptions::new().with_secret(42).with_partial_address(1));

    The account address is derived from both the public keys (which come from the secret) and the partial address. Setting the same secret with different partial addresses produces accounts that share master keys but have distinct addresses.

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

    env.deploy_opts(DeployOptions::new().with_salt(42).with_secret(100), "MyContract").without_initializer();
  • Configuration values for TestEnvironment::private_context_opts. Meant to be used by calling new and then chaining methods setting each value, e.g.:

    env.private_context_opts(PrivateContextOptions::new().at_anchor_block_number(5), ...);
  • This represents an Aztec test run, and contains all the methods utilized during one to interact with the network and manipulate its state (e.g. create accounts, make contract calls, etc.). Each test is expected to have its own instance of TestEnvironment, as tests execute in parallel and so cannot share this object.
  • 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(),
        ),
    );