Struct WithHash
pub struct WithHash<T, let M: u32>
{ /* private fields */ }
Implementations
impl<let M: u32, T> WithHash<T, M>
pub fn new(value: T) -> Self
pub fn get_value(self) -> T
pub fn get_hash(self) -> Field
pub fn public_storage_read(context: PublicContext, storage_slot: Field) -> T
pub unconstrained fn utility_public_storage_read(
context: UtilityContext,
storage_slot: Field,
) -> T
pub fn historical_public_storage_read(
header: BlockHeader,
address: AztecAddress,
storage_slot: Field,
) -> T
Trait implementations
impl<let M: u32, T> Packable for WithHash<T, M>
where
T: Packable<N = M>
where
T: Packable<N = M>
A struct that allows for efficient reading of value
Tfrom public storage in private.The efficient reads are achieved by verifying large values through a single hash check and then proving inclusion only of the hash in public storage. This reduces the number of required tree inclusion proofs from
Mto 1.Type Parameters
T: The underlying type being wrapped, must implementPackable<N>M: The number of field elements required to pack values of typeT