pub trait PreimageRecipient<Hash>: PreimageProvider<Hash> {
    type MaxSize: Get<u32>;

    fn note_preimage(bytes: BoundedVec<u8, Self::MaxSize>);
    fn unnote_preimage(hash: &Hash);
Expand description

A interface for managing preimages to hashes on chain.

Note that this API does not assume any underlying user is calling, and thus does not handle any preimage ownership or fees. Other system level logic that uses this API should implement that on their own side.

Required Associated Types

Maximum size of a preimage.

Required Methods

Store the bytes of a preimage on chain infallible due to the bounded type.

Clear a previously noted preimage. This is infallible and should be treated more like a hint - if it was not previously noted or if it is now requested, then this will not do anything.

Implementations on Foreign Types