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

# Struct CallPublicOptions

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

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

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

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

## Implementations

```rust
impl CallPublicOptions
```

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

Creates a new `CallPublicOptions` with default values, i.e. the same as if using [`TestEnvironment::call_public`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#call_public) without the `_opts` variant.

```rust
pub fn with_gas_limits(&mut 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(&mut 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(&mut 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(
    &mut 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(&mut 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.CallPublicOptions.md#with_gas_limits), [`with_teardown_gas_limits`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPublicOptions.md#with_teardown_gas_limits), [`with_max_fees_per_gas`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.CallPublicOptions.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.CallPublicOptions.md#with_max_priority_fees_per_gas) individually.
