pub trait StateSyncProvider<B>: Send + Syncwhere
B: Block,{
// Required methods
fn import(&mut self, response: StateResponse) -> ImportResult<B>;
fn next_request(&self) -> StateRequest;
fn is_complete(&self) -> bool;
fn target_number(&self) -> <<B as Block>::Header as Header>::Number;
fn target_hash(&self) -> <B as Block>::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) -> <<B as Block>::Header as Header>::Number
fn target_number(&self) -> <<B as Block>::Header as Header>::Number
Returns target block number.
Sourcefn target_hash(&self) -> <B as Block>::Hash
fn target_hash(&self) -> <B as Block>::Hash
Returns target block hash.
Sourcefn progress(&self) -> StateSyncProgress
fn progress(&self) -> StateSyncProgress
Returns state sync estimated progress.