Struct sc_consensus_grandpa::warp_proof::NetworkProvider
source · pub struct NetworkProvider<Block: BlockT, Backend: ClientBackend<Block>>where
NumberFor<Block>: BlockNumberOps,{ /* private fields */ }
Expand description
Implements network API for warp sync.
Implementations§
source§impl<Block: BlockT, Backend: ClientBackend<Block>> NetworkProvider<Block, Backend>where
NumberFor<Block>: BlockNumberOps,
impl<Block: BlockT, Backend: ClientBackend<Block>> NetworkProvider<Block, Backend>where NumberFor<Block>: BlockNumberOps,
sourcepub fn new(
backend: Arc<Backend>,
authority_set: SharedAuthoritySet<Block::Hash, NumberFor<Block>>,
hard_forks: Vec<AuthoritySetHardFork<Block>>
) -> Self
pub fn new( backend: Arc<Backend>, authority_set: SharedAuthoritySet<Block::Hash, NumberFor<Block>>, hard_forks: Vec<AuthoritySetHardFork<Block>> ) -> Self
Create a new istance for a given backend and authority set.
Trait Implementations§
source§impl<Block: BlockT, Backend: ClientBackend<Block>> WarpSyncProvider<Block> for NetworkProvider<Block, Backend>where
NumberFor<Block>: BlockNumberOps,
impl<Block: BlockT, Backend: ClientBackend<Block>> WarpSyncProvider<Block> for NetworkProvider<Block, Backend>where NumberFor<Block>: BlockNumberOps,
source§fn generate(
&self,
start: Block::Hash
) -> Result<EncodedProof, Box<dyn Error + Send + Sync>>
fn generate( &self, start: Block::Hash ) -> Result<EncodedProof, Box<dyn Error + Send + Sync>>
Generate proof starting at given block hash. The proof is accumulated until maximum proof
size is reached.
source§fn verify(
&self,
proof: &EncodedProof,
set_id: SetId,
authorities: AuthorityList
) -> Result<VerificationResult<Block>, Box<dyn Error + Send + Sync>>
fn verify( &self, proof: &EncodedProof, set_id: SetId, authorities: AuthorityList ) -> Result<VerificationResult<Block>, Box<dyn Error + Send + Sync>>
Verify warp proof against current set of authorities.
Get current list of authorities. This is supposed to be genesis authorities when starting
sync.
Auto Trait Implementations§
impl<Block, Backend> !RefUnwindSafe for NetworkProvider<Block, Backend>
impl<Block, Backend> Send for NetworkProvider<Block, Backend>
impl<Block, Backend> Sync for NetworkProvider<Block, Backend>
impl<Block, Backend> Unpin for NetworkProvider<Block, Backend>where <Block as Block>::Hash: Unpin, <<Block as Block>::Header as Header>::Number: Unpin,
impl<Block, Backend> !UnwindSafe for NetworkProvider<Block, Backend>
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.