Trait sc_network_sync::strategy::state_sync::StateSyncProvider
source · 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.