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§
Sourcefn import(&mut self, response: StateResponse) -> ImportResult<B>
 
fn import(&mut self, response: StateResponse) -> ImportResult<B>
Validate and import a state response.
Sourcefn next_request(&self) -> StateRequest
 
fn next_request(&self) -> StateRequest
Produce next state request.
Sourcefn is_complete(&self) -> bool
 
fn is_complete(&self) -> bool
Check if the state is complete.
Sourcefn target_number(&self) -> NumberFor<B>
 
fn target_number(&self) -> NumberFor<B>
Returns target block number.
Sourcefn target_hash(&self) -> B::Hash
 
fn target_hash(&self) -> B::Hash
Returns target block hash.
Sourcefn progress(&self) -> StateSyncProgress
 
fn progress(&self) -> StateSyncProgress
Returns state sync estimated progress.