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> Debug for ConsensusLog<N>where
N: Debug + Codec,
impl<N> Debug for ConsensusLog<N>where N: Debug + Codec,
source§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§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
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 )
§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,
§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 ==
.source§impl<N> Serialize for ConsensusLog<N>where
N: Serialize + Codec,
impl<N> Serialize for ConsensusLog<N>where N: Serialize + Codec,
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
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
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> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§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>,
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
.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
T
.