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

Returns whether a preimage exists for a given hash.

A value of true implies that get_preimage is Some.

Returns the preimage for a given hash.

Returns whether a preimage request exists for a given hash.

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

Cancel a previous preimage request.

Implementations on Foreign Types