Trait frame_support::traits::PreimageRecipient
source · 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§
Required Methods§
sourcefn note_preimage(bytes: BoundedVec<u8, Self::MaxSize>)
fn note_preimage(bytes: BoundedVec<u8, Self::MaxSize>)
Store the bytes of a preimage on chain.
sourcefn unnote_preimage(hash: &Hash)
fn unnote_preimage(hash: &Hash)
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.