referrerpolicy=no-referrer-when-downgrade
pub trait StateSyncProvider<B: BlockT>: Send + Sync {
    // Required methods
    fn import(&mut self, response: StateResponse) -> ImportResult<B>;
    fn next_request(&self) -> StateRequest;
    fn is_complete(&self) -> bool;
    fn target_number(&self) -> NumberFor<B>;
    fn target_hash(&self) -> B::Hash;
    fn progress(&self) -> StateSyncProgress;
}
Expand description

Generic state sync provider. Used for mocking in tests.

Required Methods§

source

fn import(&mut self, response: StateResponse) -> ImportResult<B>

Validate and import a state response.

source

fn next_request(&self) -> StateRequest

Produce next state request.

source

fn is_complete(&self) -> bool

Check if the state is complete.

source

fn target_number(&self) -> NumberFor<B>

Returns target block number.

source

fn target_hash(&self) -> B::Hash

Returns target block hash.

source

fn progress(&self) -> StateSyncProgress

Returns state sync estimated progress.

Implementors§

source§

impl<B, Client> StateSyncProvider<B> for StateSync<B, Client>
where B: BlockT, Client: ProofProvider<B> + Send + Sync + 'static,