mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Add documentation to public structs/functions in sc_tendermint
This commit is contained in:
@@ -62,12 +62,14 @@ struct ActiveAuthority<T: TendermintValidator> {
|
|||||||
announce: T::Network,
|
announce: T::Network,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Tendermint Authority. Participates in the block proposal and voting process.
|
||||||
pub struct TendermintAuthority<T: TendermintValidator> {
|
pub struct TendermintAuthority<T: TendermintValidator> {
|
||||||
import: TendermintImport<T>,
|
import: TendermintImport<T>,
|
||||||
active: Option<ActiveAuthority<T>>,
|
active: Option<ActiveAuthority<T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: TendermintValidator> TendermintAuthority<T> {
|
impl<T: TendermintValidator> TendermintAuthority<T> {
|
||||||
|
/// Create a new TendermintAuthority.
|
||||||
pub fn new(import: TendermintImport<T>) -> Self {
|
pub fn new(import: TendermintImport<T>) -> Self {
|
||||||
Self { import, active: None }
|
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
|
// 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
|
// 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
|
// 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>;
|
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>(
|
pub fn import_queue<T: TendermintValidator>(
|
||||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||||
client: Arc<T::Client>,
|
client: Arc<T::Client>,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ use crate::{
|
|||||||
authority::TendermintAuthority,
|
authority::TendermintAuthority,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Tendermint import handler.
|
||||||
pub struct TendermintImport<T: TendermintValidator> {
|
pub struct TendermintImport<T: TendermintValidator> {
|
||||||
_ta: PhantomData<T>,
|
_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>);
|
pub struct TendermintValidators<T: TendermintClient>(Refresh<T>);
|
||||||
|
|
||||||
impl<T: TendermintClient> TendermintValidators<T> {
|
impl<T: TendermintClient> TendermintValidators<T> {
|
||||||
|
|||||||
Reference in New Issue
Block a user