[][src]Trait tendermint_light_client::components::io::Io

pub trait Io: Send {
    fn __contracts_impl_fetch_light_block(
        &self,
        peer: PeerId,
        height: AtHeight
    ) -> Result<LightBlock, IoError>; fn fetch_light_block(
        &self,
        peer: PeerId,
        height: AtHeight
    ) -> Result<LightBlock, IoError> { ... } }

Interface for fetching light blocks from a full node, typically via the RPC client.

Required methods

fn __contracts_impl_fetch_light_block(
    &self,
    peer: PeerId,
    height: AtHeight
) -> Result<LightBlock, IoError>

Loading content...

Provided methods

fn fetch_light_block(
    &self,
    peer: PeerId,
    height: AtHeight
) -> Result<LightBlock, IoError>

Fetch a light block at the given height from the peer with the given peer ID.

Postcondition

  • The provider of the returned light block matches the given peer [LCV-IO-POST-PROVIDER]

Contracts

Post-condition: ret . as_ref() . map(| lb | lb . provider == peer) . unwrap_or(true)

Loading content...

Implementors

impl Io for ProdIo[src]

impl<F: Send> Io for F where
    F: Fn(PeerId, AtHeight) -> Result<LightBlock, IoError>, 
[src]

Loading content...