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

# Struct TestEnvironment

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

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

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`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md), as tests execute in parallel and so cannot share this object.

Most tests will begin by creating a [`TestEnvironment`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md) variable, and then make multiple calls to its different methods. E.g.:

```rust
#[test]
fn sample_test() {
    let mut env = TestEnvironment::new();

    // Create an account to call contracts from
    let account = env.create_light_account();
    // Deploy a compiled contract
    let contract_addr = env.deploy("MyContract").without_initializer();

    // Call a contract private function and get the return value
    let result = env.private_call(account, MyContract::at(contract_addr).sample_private_function());
    assert_eq(result, expected);
}
```

## Implementations

```rust
impl TestEnvironment
```

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

Creates a new `TestEnvironment`. This function should only be called once per test.

See [`new_opts`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#new_opts) for a variant that allows configuring the environment.

```rust
pub unconstrained fn new_opts(options: TestEnvironmentOptions) -> Self
```

Creates a new `TestEnvironment` with the configuration values in `options`. This function should only be called once per test.

#### Sample usage

```rust
let strategy = TaggingSecretStrategy::non_interactive_handshake();
let env = TestEnvironment::new_opts(
    TestEnvironmentOptions::new().with_default_tag_secret_strategy_all_modes(strategy),
);
```

```rust
pub unconstrained fn public_context<Env, T>(
    self,
    f: unconstrained fn[Env](PublicContext) -> T,
) -> T
```

Creates a `PublicContext`, which allows using aztec-nr features as if inside a public contract function. Useful for low-level testing of public state variables and utilities.

A new block is automatically mined once `public_context` returns, containing all of the side effects caused by its execution (e.g. public storage writes). It is however **NOT** possible to make any contract calls from this public context - use `call_public` for testing contract calls (though usage of `call_public` is forbidden while inside `public_context`).

Receives a callback function which is called with the created `PublicContext` - this function is where testing logic is expected to reside. Any values returned by it are bubbled-up and returned to the caller of `public_context`. Do **NOT** return the `PublicContext` from the callback function, or use it in any way outside of it - it becomes invalid once `public_context` returns.

See `public_context_at` for a variant that allows specifying the contract address.

#### Sample usage

```rust
env.public_context(|context| {
  let state_var = PublicMutable::new(context, STORAGE_SLOT);
  state_var.write(some_value);
  assert_eq(state_var.read(), some_value);
});
```

#### Advanced usage with returns

```rust
let read_value = env.public_context(|context| {
  let state_var = PublicMutable::new(context, STORAGE_SLOT);
  state_var.read()
});
```

```rust
pub unconstrained fn public_context_at<Env, T>(
    self,
    addr: AztecAddress,
    f: unconstrained fn[Env](PublicContext) -> T,
) -> T
```

Variant of [`TestEnvironment::public_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#public_context) which allows specifying the contract address in which the public context will execute, which will affect note and nullifier siloing, storage access, etc.

```rust
pub unconstrained fn private_context<Env, T>(
    self,
    f: unconstrained fn[Env](&mut PrivateContext) -> T,
) -> T
```

Creates a `PrivateContext`, which allows using aztec-nr features as if inside a private contract function. Useful for low-level testing of private state variables and utilities.

A new block is automatically mined once `private_context` returns, containing all of the side effects caused by its execution (e.g. note and nullifier emission). It is however **NOT** possible to make any contract calls from this private context, neither private nor enqueued public calls - use `call_private` and `call_public` for testing contract calls (though usage of these is forbidden while inside `private_context`).

Receives a callback function which is called with the created `PrivateContext` - this function is where testing logic is expected to reside. Any values returned by it are bubbled-up and returned to the caller of `private_context`. Do **NOT** return the `PrivateContext` from the callback function, or use it in any way outside of it - it becomes invalid once `private_context` returns.

See `private_context_at` for a variant that allows specifying the contract address, or `private_context_opts` for even more configurability.

#### Sample usage

```rust
env.private_context(|context| {
  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
  let note = SampleNote::new(some_value);
  state_var.initialize(note);
  assert_eq(state_var.get_note(), note);
});
```

#### Advanced usage with returns

```rust
let note = env.private_context(|context| {
  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
  state_var.get_note()
});
```

```rust
pub unconstrained fn private_context_at<Env, T>(
    self,
    addr: AztecAddress,
    f: unconstrained fn[Env](&mut PrivateContext) -> T,
) -> T
```

Variant of [`TestEnvironment::private_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#private_context) which allows specifying the contract address in which the private context will execute, which will affect note and nullifier siloing, storage access, etc.

```rust
pub unconstrained fn private_context_opts<Env, T>(
    _self: Self,
    opts: PrivateContextOptions,
    f: unconstrained fn[Env](&mut PrivateContext) -> T,
) -> T
```

Variant of [`TestEnvironment::private_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#private_context) which allows specifying multiple configuration values via [`PrivateContextOptions`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.PrivateContextOptions.md).

```rust
pub unconstrained fn utility_context<Env, T>(
    self,
    f: unconstrained fn[Env](UtilityContext) -> T,
) -> T
```

Creates a `UtilityContext`, which allows using aztec-nr features as if inside a utility contract function. Useful for low-level testing of private and public state variable utilities.

Receives a callback function which is called with the created `Utility` - this function is where testing logic is expected to reside. Any values returned by it are bubbled-up and returned to the caller of `utility_context`. Do **NOT** return the `Utility` from the callback function, or use it in any way outside of it - it becomes invalid once `utility_context` returns.

See `utility_context_at` for a variant that allows specifying the contract address.

#### Sample usage

```rust
env.utility_context(|context| {
  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
  let note = SampleNote::new(some_value);
  assert_eq(state_var.view_note(), note);
});
```

#### Advanced usage with returns

```rust
let note = env.utility_context(|context| {
  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
  state_var.view_note()
});
```

```rust
pub unconstrained fn utility_context_at<Env, T>(
    self,
    addr: AztecAddress,
    f: unconstrained fn[Env](UtilityContext) -> T,
) -> T
```

Variant of [`TestEnvironment::utility_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#utility_context) which allows specifying the contract address in which the utility context will execute, which will affect note and storage access.

```rust
pub unconstrained fn next_block_number(_self: Self) -> u32
```

Returns the number of the next block to be mined.

```rust
pub unconstrained fn last_block_number(_self: Self) -> u32
```

Returns the number of the last mined block. This is the default anchor block for `private_context` and `private_call`.

```rust
pub unconstrained fn last_block_timestamp(_self: Self) -> u64
```

Returns the timestamp of the last mined block. Note that block timestamps do not automatically advance - this must be done by calling `mine_block_at` or `set_next_block_timestamp`.

```rust
pub unconstrained fn mine_block_at(self, timestamp: u64)
```

Mines an empty block (i.e. with no transactions) at `timestamp`, causing followup public executions to occur at that timestamp (e.g. via `call_public` or `public_context`), and making it possible to create private executions at the specified timestamp (e.g. via `call_private` or `private_context`).

```rust
pub unconstrained fn set_next_block_timestamp(self, timestamp: u64)
```

Sets the timestamp of the next block to be mined, causing followup public executions to occur at that timestamp (e.g. via `call_public` or `public_context`).

```rust
pub unconstrained fn mine_block(_self: Self)
```

Mines an empty block (i.e. with no transactions). Note that block timestamps do not automatically advance - this must be done by calling `mine_block_at` or `set_next_block_timestamp`.

```rust
pub unconstrained fn advance_next_block_timestamp_by(_self: Self, duration: u64)
```

Sets the timestamp of the next block to be mined to be ahead of the last one by `duration`.

```rust
pub unconstrained fn send_l1_to_l2_message(
    self,
    content: Field,
    secret: Field,
    sender: EthAddress,
    recipient: AztecAddress,
) -> Field
```

Creates a message sent from the L1 to the L2.

This is required so that a contract can later consume it via [`PrivateContext::consume_l1_to_l2_message`](/aztec-nr-api/mainnet/noir_aztec/context/struct.PrivateContext.md#consume_l1_to_l2_message) or its public counterpart. An empty block is mined carrying the message leaf.

`content`, `secret`, `sender` and `recipient` must match what the consuming contract uses. The secret is hashed with the standard [`crate::hash::compute_secret_hash`](/aztec-nr-api/mainnet/noir_aztec/hash/fn.compute_secret_hash.md) - use [`send_l1_to_l2_message_from_secret_hash`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#send_l1_to_l2_message_from_secret_hash) if the contract commits to its secret differently).

Returns the global leaf index to pass as `consume_l1_to_l2_message`'s `leaf_index`.

```rust
pub unconstrained fn send_l1_to_l2_message_from_secret_hash(
    _self: Self,
    content: Field,
    secret_hash: Field,
    sender: EthAddress,
    recipient: AztecAddress,
) -> Field
```

Variant of [`send_l1_to_l2_message`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#send_l1_to_l2_message) that takes the secret hash directly.

This is only required by contracts that commit to their consumption secret with a non-standard hash function.

```rust
pub unconstrained fn create_contract_account(&mut self) -> AztecAddress
```

Creates a new account that can be used as the `from` parameter in contract calls, e.g. in `private_call` or `public_call`, or be made the owner or recipient of notes in `private_context`.

The returned account has a full set of privacy keys, so it can nullify notes, receive messages, etc. It also has an associated `SchnorrAccount` contract that can process authwit requests - the authwits can be added via the `add_private_authwit_from_call` and `add_public_authwit_from_call` helper functions. If authwits are not required, consider using `create_light_account` instead, which is a faster variant of this function.

Each call to `create_contract_account` will return a different address, and so it can be called repeatedly to generate multiple addresses. These addresses are also different from the ones that `create_light_account` returns, and so these two functions can be mixed and match to create a set of unique accounts.

```rust
pub unconstrained fn create_light_account(&mut self) -> AztecAddress
```

Creates a new account that can be used as the `from` parameter in contract calls, e.g. in `private_call` or `public_call`, or be made the owner or recipient of notes in `private_context`. This is a faster variant of `create_contract_account`, but comes with reduced capabilities.

The returned account has a full set of privacy keys, so it can nullify notes, receive messages, etc. It doesn't however have an associated account contract, so it cannot process private authwit requests. If calling contracts that rely on private authwits, use `create_contract_account` instead.

Each call to `create_light_account` will return a different address, and so it can be called repeatedly to generate multiple addresses. These addresses are also different from the ones that `create_contract_account` returns, and so these two functions can be mixed and match to create a set of unique accounts.

See [`create_light_account_opts`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#create_light_account_opts) for a variant that allows controlling the account's secret and partial address, e.g. to create accounts that share keys but have different addresses.

```rust
pub unconstrained fn create_light_account_opts(
    &mut self,
    opts: CreateAccountOptions,
) -> AztecAddress
```

Variant of `create_light_account` which allows specifying configuration values via `CreateAccountOptions`, such as a custom secret or partial address. If not specified, the secret and partial address default to values from internal counters.

Setting the same secret with different partial addresses produces accounts that share master keys but have distinct addresses.

```rust
pub unconstrained fn deploy<let N: u32>(
    &mut self,
    path: str<N>,
) -> ContractDeployment<N>
```

Prepares a contract for deployment, so that its private, public and utility functions can be called. The contract **must be already compiled** before tests are run, and **must be recompiled if changed** for the tests to deploy the updated version.

In order to finalize the deployment, the proper initializer function must be specified via one of the associated methods. For more information on how to specify the path and initialization, read the sections below.

#### Path Contracts can be deployed from either the same crate as the test, from a different crate in the same

workspace, or from an altogether independent crate.

If deploying contracts from the same crate as the test, just refer to it by its name:

```rust
TestEnvironment::new().deploy("MyContract");
```

If deploying contracts from a different crate in the same workspace, use `@crate_name/contract_name`:

```rust
TestEnvironment::new().deploy("@my_contract_crate/MyContract");
```

If deploying contracts from a crate not in the workspace, use `path_to_crate/contract_name`, with the crate path relative to the current workspace:

```rust
TestEnvironment::new().deploy("../my_other_crate/MyContract");
```

#### Initialization If no initializer function needs to be called, use `without_initializer`:

```rust
let my_contract = TestEnvironment::new().deploy("MyContract").without_initializer();
```

For private initializers, use `with_private_initializer`:

```rust
let my_contract = TestEnvironment::new().deploy("MyContract").with_private_initializer(
  PrivateInitContract::interface().private_init_fn(init_args)
);
```

For public initializers, use `with_public_initializer`:

```rust
let my_contract = TestEnvironment::new().deploy("MyContract").with_public_initializer(
  PublicInitContract::interface().public_init_fn(init_args)
);
```

```rust
pub unconstrained fn deploy_opts<let N: u32>(
    &mut self,
    opts: DeployOptions,
    path: str<N>,
) -> ContractDeployment<N>
```

Variant of `deploy` which allows specifying configuration values via `DeployOptions`, such as a custom salt, secret or immutables hash. If not specified, the salt and secret default to values from internal counters, and the immutables hash defaults to 0.

```rust
pub unconstrained fn call_private<let M: u32, let N: u32, T>(
    self,
    from: AztecAddress,
    call: PrivateCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Performs a private contract function call, including the processing of any nested private calls and enqueued public calls. Returns the result of the called function.

The function is called by the `from` address - use `create_contract_account` or `create_light_account` to generate sender addresses, depending on whether support for private authwit verification is required or not. Note that execution will begin directly in the called function - no entrypoint function in `from` will be executed.

A transaction is created containing all side effects of the call, which is then included in a block that gets mined by the time `call_private` returns. It is therefore possible to chain multiple private or public function calls that operate on the result of prior calls.

The `call` value can be obtained by calling the appropriate method on a contract type. E.g.:

```rust
let caller = env.create_light_account();
let contract_addr = env.deploy("SampleContract").without_initializer();
let return_value = env.call_private(caller, SampleContract::at(contract_addr).sample_private_function());
```

```rust
pub unconstrained fn call_private_opts<let M: u32, let N: u32, let S: u32, let U: u32, T>(
    _self: Self,
    from: AztecAddress,
    opts: CallPrivateOptions<S, U>,
    call: PrivateCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Variant of [`TestEnvironment::call_private`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#call_private) which allows specifying multiple configuration values via [`CallPrivateOptions`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.CallPrivateOptions.md), including additional account scopes, authorized utility call targets, and gas settings.

```rust
pub unconstrained fn view_private<let M: u32, let N: u32, T>(
    self,
    from: AztecAddress,
    call: PrivateStaticCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Variant of `call_private` for private `#[view]` functions.

Unlike `call_private`, no transaction is created and no block is mined (since `#[view]` functions are only executable in a static context, and these produce no side effects).

The `from` parameter specifies the account from whose perspective the view is executed. This affects scope isolation - only notes scoped to this account will be visible during execution.

```rust
pub unconstrained fn view_private_opts<let M: u32, let N: u32, let S: u32, let U: u32, T>(
    _self: Self,
    from: AztecAddress,
    opts: ViewPrivateOptions<S, U>,
    call: PrivateStaticCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Variant of `view_private` which allows specifying multiple configuration values via `ViewPrivateOptions`.

```rust
pub unconstrained fn execute_utility<let M: u32, let N: u32, T>(
    self,
    call: UtilityCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Performs a utility contract function call and returns the result of the called function.

The `call` value can be obtained by calling the appropriate method on a contract type. E.g.:

```rust
let contract_addr = env.deploy("SampleContract").without_initializer();
let return_value = env.execute_utility(SampleContract::at(contract_addr).sample_utility_function());
```

```rust
pub unconstrained fn execute_utility_opts<let M: u32, let N: u32, let U: u32, T>(
    _self: Self,
    opts: ExecuteUtilityOptions<U>,
    call: UtilityCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Variant of `execute_utility` which allows specifying configuration values via `ExecuteUtilityOptions`, such as `msg_sender` or authorizing cross-contract utility calls.

```rust
pub unconstrained fn offchain_messages(_self: Self) -> BoundedVec<OffchainMessage, 64>
```

Returns offchain messages emitted by the last top-level call into TXE.

The returned `BoundedVec<OffchainMessage, _>` can be passed directly to a contract's `offchain_receive` utility function to ingest the messages into the recipient's private state.

Each returned message is populated with:

- `ciphertext`, `recipient`: decoded from the raw emitted payload.
- `tx_hash`: `Option::some(hash)` for tx-producing entry points (`call_private`, `call_public`); `Option::none()` for tx-less entry points (`execute_utility`, `private_context`, `utility_context`).
- `anchor_block_timestamp`: the timestamp of the block the top-level call was anchored against, matching the value the production flow would produce.

Returns up to `MAX_OFFCHAIN_EFFECTS_PER_TXE_QUERY` messages. The caller is responsible for splitting the result into batches that fit `MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL` before forwarding each batch to `offchain_receive`.

#### Example

```rust
env.call_private(sender, Token::at(token).transfer_in_private_with_offchain_delivery(...));
let messages = env.offchain_messages();
let mut batch: BoundedVec<_, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();
for i in 0..messages.len() { batch.push(messages.get(i)); }
env.execute_utility(Token::at(token).offchain_receive(batch));
```

```rust
pub unconstrained fn call_public<let M: u32, let N: u32, T>(
    _self: Self,
    from: AztecAddress,
    call: PublicCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Performs a public contract function call, including the processing of any nested public calls. Returns the result of the called function.

The function is called by the `from` address - use `create_contract_account` or `create_light_account` to generate sender addresses. Note that execution will begin directly in the called function - no private entrypoint function in `from` will be executed - in fact no private execution of any kind will be performed.

A transaction is created containing all side effects of the call, which is then included in a block that gets mined by the time `call_public` returns. It is therefore possible to chain multiple private or public function calls that operate on the result of prior calls.

The `call` value can be obtained by calling the appropriate method on a contract type. E.g.:

```rust
let caller = env.create_light_account();
let contract_addr = env.deploy("SampleContract").without_initializer();
let return_value = env.call_public(caller, SampleContract::at(contract_addr).sample_public_function());
```

```rust
pub unconstrained fn call_public_opts<let M: u32, let N: u32, T>(
    _self: Self,
    from: AztecAddress,
    opts: CallPublicOptions,
    call: PublicCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Variant of [`TestEnvironment::call_public`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#call_public) which allows specifying gas settings via [`CallPublicOptions`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.CallPublicOptions.md).

```rust
pub unconstrained fn call_public_incognito<let M: u32, let N: u32, T>(
    _self: Self,
    call: PublicCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Performs a public contract function call, including the processing of any nested public calls. Returns the result of the called function. Variant of `call_public`, but the `from` address (`msg_sender`) is set to "null".

```rust
pub unconstrained fn view_public<let M: u32, let N: u32, T>(
    _self: Self,
    call: PublicStaticCall<M, N, T>,
) -> T
where
    T: Deserialize
```

Variant of `call_public` for public `#[view]` functions.

Unlike `call_public`, no transaction is created and no block is mined (since `#[view]` functions are only executable in a static context, and these produce no side effects). The `msg_sender` is set to "null", since view calls have no real caller.

```rust
pub unconstrained fn view_public_incognito<let M: u32, let N: u32, T>(
    self,
    call: PublicStaticCall<M, N, T>,
) -> T
where
    T: Deserialize
```

👎 Deprecated: use \`TestEnvironment::view_public\` instead

```rust
pub unconstrained fn discover_note<Note>(self, note_message: NoteMessage<Note>)
where
    Note: Packable,
    Note: NoteType,
    Note: NoteHash
```

Discovers a note from a [`NoteMessage`](/aztec-nr-api/mainnet/noir_aztec/note/struct.NoteMessage.md), which is expected to have been created in the last transaction (typically via [`TestEnvironment::private_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#private_context)) so that it can be retrieved in later transactions. This mimics the normal message processing that takes place automatically in contracts.

[`NoteMessage`](/aztec-nr-api/mainnet/noir_aztec/note/struct.NoteMessage.md) values are typically returned by aztec-nr state variables that create notes and need to notify a recipient of their existence. Instead of going through the message encoding, encryption and delivery that would regularly take place in a contract, this function simply takes the [`NoteMessage`](/aztec-nr-api/mainnet/noir_aztec/note/struct.NoteMessage.md) and processes it as needed to discover the underlying note.

See [`TestEnvironment::discover_note_at`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#discover_note_at) for a variant that allows specifying the contract address the note belongs to.

#### Sample usage

The most common way to invoke this function is to obtain a note message created during the execution of a [`TestEnvironment::private_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#private_context):

```rust
let note_message = env.private_context(|context| create_note(context, storage_slot, note));

env.discover_note(note_message);

env.private_context(|context| { let (hinted_note, _) = get_note::<MockNote>(context, storage_slot); });
```

```rust
pub unconstrained fn discover_note_at<Note>(
    self,
    addr: AztecAddress,
    note_message: NoteMessage<Note>,
)
where
    Note: Packable,
    Note: NoteType,
    Note: NoteHash
```

Variant of [`TestEnvironment::discover_note`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#discover_note) which allows specifying the contract address the note belongs to, which is required when the note was not emitted in the default address used by [`TestEnvironment::private_context`](/aztec-nr-api/mainnet/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#private_context).

```rust
let note_message = env.private_context_at(contract_address, |context| {
    create_note(context, storage_slot, note)
});

env.discover_note_at(contract_address, note_message);

env.private_context_at(contract_address, |context| {
    let (hinted_note, _) = get_note::<MockNote>(context, storage_slot);
});
```
