referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::traits::PreimageProvider

pub trait PreimageProvider<Hash> {
    // Required methods
    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§

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.

fn get_preimage(hash: &Hash) -> Option<Vec<u8>>

Returns the preimage for a given hash.

fn preimage_requested(hash: &Hash) -> bool

Returns whether a preimage request exists for a given hash.

fn request_preimage(hash: &Hash)

Request that someone report a preimage. Providers use this to optimise the economics for preimage reporting.

fn unrequest_preimage(hash: &Hash)

Cancel a previous preimage request.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<Hash> PreimageProvider<Hash> for ()

Implementors§