pub enum ConsensusLog<N: Codec> {
ScheduledChange(ScheduledChange<N>),
ForcedChange(N, ScheduledChange<N>),
OnDisabled(AuthorityIndex),
Pause(N),
Resume(N),
}
Expand description
An consensus log item for GRANDPA.
Variants§
ScheduledChange(ScheduledChange<N>)
Schedule an authority set change.
The earliest digest of this type in a single block will be respected,
provided that there is no ForcedChange
digest. If there is, then the
ForcedChange
will take precedence.
No change should be scheduled if one is already and the delay has not passed completely.
This should be a pure function: i.e. as long as the runtime can interpret the digest type it should return the same result regardless of the current state.
ForcedChange(N, ScheduledChange<N>)
Force an authority set change.
Forced changes are applied after a delay of imported blocks, while pending changes are applied after a delay of finalized blocks.
The earliest digest of this type in a single block will be respected, with others ignored.
No change should be scheduled if one is already and the delay has not passed completely.
This should be a pure function: i.e. as long as the runtime can interpret the digest type it should return the same result regardless of the current state.
OnDisabled(AuthorityIndex)
Note that the authority with given index is disabled until the next change.
Pause(N)
A signal to pause the current authority set after the given delay. After finalizing the block at delay the authorities should stop voting.
Resume(N)
A signal to resume the current authority set after the given delay. After authoring the block at delay the authorities should resume voting.
Implementations§
source§impl<N: Codec> ConsensusLog<N>
impl<N: Codec> ConsensusLog<N>
sourcepub fn try_into_change(self) -> Option<ScheduledChange<N>>
pub fn try_into_change(self) -> Option<ScheduledChange<N>>
Try to cast the log entry as a contained signal.
sourcepub fn try_into_forced_change(self) -> Option<(N, ScheduledChange<N>)>
pub fn try_into_forced_change(self) -> Option<(N, ScheduledChange<N>)>
Try to cast the log entry as a contained forced signal.
sourcepub fn try_into_pause(self) -> Option<N>
pub fn try_into_pause(self) -> Option<N>
Try to cast the log entry as a contained pause signal.
sourcepub fn try_into_resume(self) -> Option<N>
pub fn try_into_resume(self) -> Option<N>
Try to cast the log entry as a contained resume signal.
Trait Implementations§
source§impl<N: Clone + Codec> Clone for ConsensusLog<N>
impl<N: Clone + Codec> Clone for ConsensusLog<N>
source§fn clone(&self) -> ConsensusLog<N>
fn clone(&self) -> ConsensusLog<N>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<N> Decode for ConsensusLog<N>where
ScheduledChange<N>: Decode,
N: Decode + Codec,
impl<N> Decode for ConsensusLog<N>where ScheduledChange<N>: Decode, N: Decode + Codec,
source§impl<N> Encode for ConsensusLog<N>where
ScheduledChange<N>: Encode,
N: Encode + Codec,
impl<N> Encode for ConsensusLog<N>where ScheduledChange<N>: Encode, N: Encode + Codec,
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<N: PartialEq + Codec> PartialEq<ConsensusLog<N>> for ConsensusLog<N>
impl<N: PartialEq + Codec> PartialEq<ConsensusLog<N>> for ConsensusLog<N>
source§fn eq(&self, other: &ConsensusLog<N>) -> bool
fn eq(&self, other: &ConsensusLog<N>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<N> EncodeLike<ConsensusLog<N>> for ConsensusLog<N>where ScheduledChange<N>: Encode, N: Encode + Codec,
impl<N: Eq + Codec> Eq for ConsensusLog<N>
impl<N: Codec> StructuralEq for ConsensusLog<N>
impl<N: Codec> StructuralPartialEq for ConsensusLog<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for ConsensusLog<N>where N: RefUnwindSafe,
impl<N> Send for ConsensusLog<N>where N: Send,
impl<N> Sync for ConsensusLog<N>where N: Sync,
impl<N> Unpin for ConsensusLog<N>where N: Unpin,
impl<N> UnwindSafe for ConsensusLog<N>where N: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
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
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.