Trait ibc_core::client::context::client_state::ClientStateValidation
source · pub trait ClientStateValidation<V>: ClientStateCommonwhere
V: ClientValidationContext,{
// Required methods
fn verify_client_message(
&self,
ctx: &V,
client_id: &ClientId,
client_message: Any
) -> Result<(), ClientError>;
fn check_for_misbehaviour(
&self,
ctx: &V,
client_id: &ClientId,
client_message: Any
) -> Result<bool, ClientError>;
fn status(
&self,
ctx: &V,
client_id: &ClientId
) -> Result<Status, ClientError>;
}
Expand description
ClientState
methods which require access to the client’s validation
context
The generic type V
enables light client developers to expand the set of
methods available under the ClientValidationContext
trait and use them in
their implementation for validating a client state transition.
impl<V> ClientStateValidation<V> for MyClientState
where
V: ClientValidationContext + MyValidationContext,
{
// `MyValidationContext` methods available
}
trait MyValidationContext {
// My Context methods
}
Required Methods§
sourcefn verify_client_message(
&self,
ctx: &V,
client_id: &ClientId,
client_message: Any
) -> Result<(), ClientError>
fn verify_client_message( &self, ctx: &V, client_id: &ClientId, client_message: Any ) -> Result<(), ClientError>
verify_client_message must verify a client_message. A client_message could be a Header, Misbehaviour. It must handle each type of client_message appropriately. Calls to check_for_misbehaviour, update_state, and update_state_on_misbehaviour will assume that the content of the client_message has been verified and can be trusted. An error should be returned if the client_message fails to verify.
sourcefn check_for_misbehaviour(
&self,
ctx: &V,
client_id: &ClientId,
client_message: Any
) -> Result<bool, ClientError>
fn check_for_misbehaviour( &self, ctx: &V, client_id: &ClientId, client_message: Any ) -> Result<bool, ClientError>
Checks for evidence of a misbehaviour in Header or Misbehaviour type. It assumes the client_message has already been verified.