pub struct TendermintHost {
pub chain_id: ChainId,
pub history: Vec<TmLightBlock>,
}Expand description
A host that produces Tendermint blocks and interfaces with Tendermint light clients.
Fields§
§chain_id: ChainIdUnique identifier for the chain.
history: Vec<TmLightBlock>The chain of blocks underlying this context.
Implementations§
Source§impl TendermintHost
impl TendermintHost
Sourcepub fn builder() -> TendermintHostBuilder
pub fn builder() -> TendermintHostBuilder
Create an instance of TendermintHost using the builder syntax
Trait Implementations§
Source§impl Debug for TendermintHost
impl Debug for TendermintHost
Source§impl Default for TendermintHost
impl Default for TendermintHost
Source§impl TestHost for TendermintHost
impl TestHost for TendermintHost
Source§type Block = TmLightBlock
type Block = TmLightBlock
The type of block produced by the host.
Source§type BlockParams = BlockParams
type BlockParams = BlockParams
The type of block parameter to produce a block.
Source§type LightClientParams = ClientStateConfig
type LightClientParams = ClientStateConfig
The type of light client parameters to produce a light client state.
Source§type ClientState = ClientState
type ClientState = ClientState
The type of client state produced by the host.
Source§fn push_block(&mut self, block: Self::Block)
fn push_block(&mut self, block: Self::Block)
Add a block to the host chain.
Source§fn generate_block(
&self,
commitment_root: Vec<u8>,
height: u64,
timestamp: Timestamp,
params: &Self::BlockParams,
) -> Self::Block
fn generate_block( &self, commitment_root: Vec<u8>, height: u64, timestamp: Timestamp, params: &Self::BlockParams, ) -> Self::Block
Generate a block at the given height and timestamp, using the provided parameters.
Source§fn generate_client_state(
&self,
latest_height: &Height,
params: &Self::LightClientParams,
) -> Self::ClientState
fn generate_client_state( &self, latest_height: &Height, params: &Self::LightClientParams, ) -> Self::ClientState
Generate a client state using the block at the given height and the provided parameters.
Source§fn latest_height(&self) -> Height
fn latest_height(&self) -> Height
The latest height of the host chain.
Source§fn latest_block(&self) -> Self::Block
fn latest_block(&self) -> Self::Block
The latest block of the host chain.
Source§fn get_block(&self, target_height: &Height) -> Option<Self::Block>
fn get_block(&self, target_height: &Height) -> Option<Self::Block>
Get the block at the given height.
Source§fn commit_block(
&mut self,
commitment_root: Vec<u8>,
block_time: Duration,
params: &Self::BlockParams,
)
fn commit_block( &mut self, commitment_root: Vec<u8>, block_time: Duration, params: &Self::BlockParams, )
Commit a block with commitment root to the blockchain, by extending the history of blocks.
fn validate(&self) -> Result<(), String>
Auto Trait Implementations§
impl Freeze for TendermintHost
impl RefUnwindSafe for TendermintHost
impl Send for TendermintHost
impl Sync for TendermintHost
impl Unpin for TendermintHost
impl UnwindSafe for TendermintHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request