Trait frame_support::traits::PreimageProvider
source · pub trait PreimageProvider<Hash> {
fn have_preimage(hash: &Hash) -> bool;
fn get_preimage(hash: &Hash) -> Option<Vec<u8>>;
fn preimage_requested(hash: &Hash) -> bool;
fn request_preimage(hash: &Hash);
fn unrequest_preimage(hash: &Hash);
}
Expand description
A interface for looking up preimages from their hash on chain.
Required Methods§
sourcefn have_preimage(hash: &Hash) -> bool
fn have_preimage(hash: &Hash) -> bool
Returns whether a preimage exists for a given hash.
A value of true
implies that get_preimage
is Some
.
sourcefn preimage_requested(hash: &Hash) -> bool
fn preimage_requested(hash: &Hash) -> bool
Returns whether a preimage request exists for a given hash.
sourcefn request_preimage(hash: &Hash)
fn request_preimage(hash: &Hash)
Request that someone report a preimage. Providers use this to optimise the economics for preimage reporting.
sourcefn unrequest_preimage(hash: &Hash)
fn unrequest_preimage(hash: &Hash)
Cancel a previous preimage request.