Trait TestBlock

Source
pub trait TestBlock: Clone + Debug {
    type Header: TestHeader;

    // Required methods
    fn height(&self) -> Height;
    fn timestamp(&self) -> Timestamp;
    fn into_header_with_trusted(self, trusted_block: &Self) -> Self::Header;

    // Provided method
    fn into_header(self) -> Self::Header { ... }
}
Expand description

TestBlock is a trait that defines the interface for a block produced by a host blockchain.

Required Associated Types§

Source

type Header: TestHeader

The type of header can be extracted from the block.

Required Methods§

Source

fn height(&self) -> Height

The height of the block.

Source

fn timestamp(&self) -> Timestamp

The timestamp of the block.

Source

fn into_header_with_trusted(self, trusted_block: &Self) -> Self::Header

Extract the IBC header using the target and trusted blocks.

Provided Methods§

Source

fn into_header(self) -> Self::Header

Extract the IBC header only using the target block (sets the trusted block to itself).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TestBlock for TmLightBlock

Source§

type Header = TendermintHeader

Source§

fn height(&self) -> Height

Source§

fn timestamp(&self) -> Timestamp

Source§

fn into_header_with_trusted(self, trusted_block: &Self) -> Self::Header

Implementors§