1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use ibc::ics02_client::client_state::AnyClientState;
use crate::chain::Chain;
use crate::error;
use ibc::ics02_client::events::UpdateClient;
use ibc::ics02_client::misbehaviour::AnyMisbehaviour;
pub mod tendermint;
#[cfg(test)]
pub mod mock;
pub trait LightBlock<C: Chain>: Send + Sync {
fn signed_header(&self) -> &C::Header;
}
pub trait LightClient<C: Chain>: Send + Sync {
fn verify(
&mut self,
trusted: ibc::Height,
target: ibc::Height,
client_state: &AnyClientState,
) -> Result<C::LightBlock, error::Error>;
fn check_misbehaviour(
&mut self,
update: UpdateClient,
client_state: &AnyClientState,
) -> Result<Option<AnyMisbehaviour>, error::Error>;
fn fetch(&mut self, height: ibc::Height) -> Result<C::LightBlock, error::Error>;
}