pub mod io;
pub mod tendermint;
use ibc_relayer_types::core::ics02_client::events::UpdateClient;
use ibc_relayer_types::Height;
use crate::chain::endpoint::ChainEndpoint;
use crate::client_state::AnyClientState;
use crate::error;
use crate::misbehaviour::MisbehaviourEvidence;
pub trait LightBlock<C: ChainEndpoint>: Send + Sync {
fn signed_header(&self) -> &C::Header;
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Verified<H> {
pub target: H,
pub supporting: Vec<H>,
}
pub trait LightClient<C: ChainEndpoint>: Send + Sync {
fn header_and_minimal_set(
&mut self,
trusted: Height,
target: Height,
client_state: &AnyClientState,
now: C::Time,
) -> Result<Verified<C::Header>, error::Error>;
fn verify(
&mut self,
trusted: Height,
target: Height,
client_state: &AnyClientState,
now: C::Time,
) -> Result<Verified<C::LightBlock>, error::Error>;
fn detect_misbehaviour(
&mut self,
update: &UpdateClient,
client_state: &AnyClientState,
now: C::Time,
) -> Result<Option<MisbehaviourEvidence>, error::Error>;
fn fetch(&mut self, height: Height) -> Result<C::LightBlock, error::Error>;
}