aztec-nr - noir_aztec::context::returns_hash

Struct ReturnsHash

pub struct ReturnsHash
{ /* private fields */ }

A hash that represents a private contract function call's return value. Call get_preimage to get the underlying value.

The kernels don't process the actual return values but instead their hashes, so it is up to contracts to populate oracles with the preimages of these hashes on return to make them available to their callers.

Public calls don't utilize this mechanism since the AVM does process the full return values.

Implementations

impl ReturnsHash

pub fn new(hash: Field) -> Self pub fn get_preimage<T>(self) -> T
where T: Deserialize

Fetches the underlying return value from an oracle, constraining that it corresponds to the return data hash.