[][src]Trait sc_service::client::light::fetcher::FetchChecker

pub trait FetchChecker<Block>: Send + Sync where
    Block: Block
{ fn check_header_proof(
        &self,
        request: &RemoteHeaderRequest<<Block as Block>::Header>,
        header: Option<<Block as Block>::Header>,
        remote_proof: StorageProof
    ) -> Result<<Block as Block>::Header, Error>;
fn check_read_proof(
        &self,
        request: &RemoteReadRequest<<Block as Block>::Header>,
        remote_proof: StorageProof
    ) -> Result<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>, Error>;
fn check_read_child_proof(
        &self,
        request: &RemoteReadChildRequest<<Block as Block>::Header>,
        remote_proof: StorageProof
    ) -> Result<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>, Error>;
fn check_execution_proof(
        &self,
        request: &RemoteCallRequest<<Block as Block>::Header>,
        remote_proof: StorageProof
    ) -> Result<Vec<u8>, Error>;
fn check_changes_proof(
        &self,
        request: &RemoteChangesRequest<<Block as Block>::Header>,
        proof: ChangesProof<<Block as Block>::Header>
    ) -> Result<Vec<(<<Block as Block>::Header as Header>::Number, u32)>, Error>;
fn check_body_proof(
        &self,
        request: &RemoteBodyRequest<<Block as Block>::Header>,
        body: Vec<<Block as Block>::Extrinsic>
    ) -> Result<Vec<<Block as Block>::Extrinsic>, Error>; }

Light client remote data checker.

Implementations of this trait should not use any prunable blockchain data except that is passed to its methods.

Required methods

fn check_header_proof(
    &self,
    request: &RemoteHeaderRequest<<Block as Block>::Header>,
    header: Option<<Block as Block>::Header>,
    remote_proof: StorageProof
) -> Result<<Block as Block>::Header, Error>

Check remote header proof.

fn check_read_proof(
    &self,
    request: &RemoteReadRequest<<Block as Block>::Header>,
    remote_proof: StorageProof
) -> Result<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>, Error>

Check remote storage read proof.

fn check_read_child_proof(
    &self,
    request: &RemoteReadChildRequest<<Block as Block>::Header>,
    remote_proof: StorageProof
) -> Result<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>, Error>

Check remote storage read proof.

fn check_execution_proof(
    &self,
    request: &RemoteCallRequest<<Block as Block>::Header>,
    remote_proof: StorageProof
) -> Result<Vec<u8>, Error>

Check remote method execution proof.

fn check_changes_proof(
    &self,
    request: &RemoteChangesRequest<<Block as Block>::Header>,
    proof: ChangesProof<<Block as Block>::Header>
) -> Result<Vec<(<<Block as Block>::Header as Header>::Number, u32)>, Error>

Check remote changes query proof.

fn check_body_proof(
    &self,
    request: &RemoteBodyRequest<<Block as Block>::Header>,
    body: Vec<<Block as Block>::Extrinsic>
) -> Result<Vec<<Block as Block>::Extrinsic>, Error>

Check remote body proof.

Loading content...

Implementations on Foreign Types

impl<Block> FetchChecker<Block> for AlwaysBadChecker where
    Block: Block
[src]

Loading content...

Implementors

impl<E, Block, H, S> FetchChecker<Block> for LightDataChecker<E, H, Block, S> where
    Block: BlockT,
    E: CodeExecutor + Clone + 'static,
    H: Hasher,
    H::Out: Ord + Codec + 'static,
    S: BlockchainStorage<Block>, 
[src]

Loading content...