mirror of
https://github.com/serai-dex/serai.git
synced 2025-02-03 11:46:31 +00:00
Add documentation to public structs/functions in sc_tendermint
This commit is contained in:
parent
c4976ff97d
commit
8f065533dc
5 changed files with 12 additions and 0 deletions
|
@ -62,12 +62,14 @@ struct ActiveAuthority<T: TendermintValidator> {
|
|||
announce: T::Network,
|
||||
}
|
||||
|
||||
/// Tendermint Authority. Participates in the block proposal and voting process.
|
||||
pub struct TendermintAuthority<T: TendermintValidator> {
|
||||
import: TendermintImport<T>,
|
||||
active: Option<ActiveAuthority<T>>,
|
||||
}
|
||||
|
||||
impl<T: TendermintValidator> TendermintAuthority<T> {
|
||||
/// Create a new TendermintAuthority.
|
||||
pub fn new(import: TendermintImport<T>) -> Self {
|
||||
Self { import, active: None }
|
||||
}
|
||||
|
|
|
@ -67,6 +67,12 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// Tendermint's Select Chain, where the best chain is defined as the most recently finalized
|
||||
/// block.
|
||||
///
|
||||
/// leaves panics on call due to not being applicable under Tendermint. Any provided answer would
|
||||
/// have conflicts best left unraised.
|
||||
//
|
||||
// SelectChain, while provided by Substrate and part of PartialComponents, isn't used by Substrate
|
||||
// It's common between various block-production/finality crates, yet Substrate as a system doesn't
|
||||
// rely on it, which is good, because its definition is explicitly incompatible with Tendermint
|
||||
|
|
|
@ -102,6 +102,8 @@ pub trait TendermintValidator: TendermintClient {
|
|||
|
||||
pub type TendermintImportQueue<Block, Transaction> = BasicQueue<Block, Transaction>;
|
||||
|
||||
/// Create an import queue, additionally returning the Tendermint Import object iself, enabling
|
||||
/// creating an author later as well.
|
||||
pub fn import_queue<T: TendermintValidator>(
|
||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||
client: Arc<T::Client>,
|
||||
|
|
|
@ -22,6 +22,7 @@ use crate::{
|
|||
authority::TendermintAuthority,
|
||||
};
|
||||
|
||||
/// Tendermint import handler.
|
||||
pub struct TendermintImport<T: TendermintValidator> {
|
||||
_ta: PhantomData<T>,
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ impl<T: TendermintClient> Deref for Refresh<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Tendermint validators observer, providing data on the active validators.
|
||||
pub struct TendermintValidators<T: TendermintClient>(Refresh<T>);
|
||||
|
||||
impl<T: TendermintClient> TendermintValidators<T> {
|
||||
|
|
Loading…
Reference in a new issue