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§

source

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.

source

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

Returns the preimage for a given hash.

source

fn preimage_requested(hash: &Hash) -> bool

Returns whether a preimage request exists for a given hash.

source

fn request_preimage(hash: &Hash)

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

source

fn unrequest_preimage(hash: &Hash)

Cancel a previous preimage request.

Implementations on Foreign Types§

source§

impl<Hash> PreimageProvider<Hash> for ()

Implementors§