pub struct ClientState(/* private fields */);
Expand description
Newtype wrapper around the ClientState
type, imported from the
ibc-client-tendermint-types
crate. This wrapper exists so that we can
bypass Rust’s orphan rules and implement traits from
ibc::core::client::context
on the ClientState
type.
Implementations§
Source§impl ClientState
impl ClientState
pub fn inner(&self) -> &ClientStateType
Trait Implementations§
Source§impl ClientStateCommon for ClientState
impl ClientStateCommon for ClientState
Source§fn verify_consensus_state(
&self,
consensus_state: Any,
host_timestamp: &Timestamp,
) -> Result<(), ClientError>
fn verify_consensus_state( &self, consensus_state: Any, host_timestamp: &Timestamp, ) -> Result<(), ClientError>
consensus_state
. Read moreSource§fn client_type(&self) -> ClientType
fn client_type(&self) -> ClientType
Source§fn latest_height(&self) -> Height
fn latest_height(&self) -> Height
Source§fn validate_proof_height(&self, proof_height: Height) -> Result<(), ClientError>
fn validate_proof_height(&self, proof_height: Height) -> Result<(), ClientError>
Source§fn verify_upgrade_client(
&self,
upgraded_client_state: Any,
upgraded_consensus_state: Any,
proof_upgrade_client: CommitmentProofBytes,
proof_upgrade_consensus_state: CommitmentProofBytes,
root: &CommitmentRoot,
) -> Result<(), ClientError>
fn verify_upgrade_client( &self, upgraded_client_state: Any, upgraded_consensus_state: Any, proof_upgrade_client: CommitmentProofBytes, proof_upgrade_consensus_state: CommitmentProofBytes, root: &CommitmentRoot, ) -> Result<(), ClientError>
Source§fn serialize_path(&self, path: Path) -> Result<PathBytes, ClientError>
fn serialize_path(&self, path: Path) -> Result<PathBytes, ClientError>
Source§fn verify_membership_raw(
&self,
prefix: &CommitmentPrefix,
proof: &CommitmentProofBytes,
root: &CommitmentRoot,
path: PathBytes,
value: Vec<u8>,
) -> Result<(), ClientError>
fn verify_membership_raw( &self, prefix: &CommitmentPrefix, proof: &CommitmentProofBytes, root: &CommitmentRoot, path: PathBytes, value: Vec<u8>, ) -> Result<(), ClientError>
Source§fn verify_non_membership_raw(
&self,
prefix: &CommitmentPrefix,
proof: &CommitmentProofBytes,
root: &CommitmentRoot,
path: PathBytes,
) -> Result<(), ClientError>
fn verify_non_membership_raw( &self, prefix: &CommitmentPrefix, proof: &CommitmentProofBytes, root: &CommitmentRoot, path: PathBytes, ) -> Result<(), ClientError>
Source§fn verify_membership(
&self,
prefix: &CommitmentPrefix,
proof: &CommitmentProofBytes,
root: &CommitmentRoot,
path: Path,
value: Vec<u8>,
) -> Result<(), ClientError>
fn verify_membership( &self, prefix: &CommitmentPrefix, proof: &CommitmentProofBytes, root: &CommitmentRoot, path: Path, value: Vec<u8>, ) -> Result<(), ClientError>
Source§fn verify_non_membership(
&self,
prefix: &CommitmentPrefix,
proof: &CommitmentProofBytes,
root: &CommitmentRoot,
path: Path,
) -> Result<(), ClientError>
fn verify_non_membership( &self, prefix: &CommitmentPrefix, proof: &CommitmentProofBytes, root: &CommitmentRoot, path: Path, ) -> Result<(), ClientError>
Source§impl<E> ClientStateExecution<E> for ClientStatewhere
E: ExtClientExecutionContext,
E::ClientStateRef: From<ClientState>,
ConsensusState: Convertible<E::ConsensusStateRef>,
<ConsensusState as TryFrom<E::ConsensusStateRef>>::Error: Into<ClientError>,
impl<E> ClientStateExecution<E> for ClientStatewhere
E: ExtClientExecutionContext,
E::ClientStateRef: From<ClientState>,
ConsensusState: Convertible<E::ConsensusStateRef>,
<ConsensusState as TryFrom<E::ConsensusStateRef>>::Error: Into<ClientError>,
Source§fn initialise(
&self,
ctx: &mut E,
client_id: &ClientId,
consensus_state: Any,
) -> Result<(), ClientError>
fn initialise( &self, ctx: &mut E, client_id: &ClientId, consensus_state: Any, ) -> Result<(), ClientError>
Source§fn update_state(
&self,
ctx: &mut E,
client_id: &ClientId,
header: Any,
) -> Result<Vec<Height>, ClientError>
fn update_state( &self, ctx: &mut E, client_id: &ClientId, header: Any, ) -> Result<Vec<Height>, ClientError>
Source§fn update_state_on_misbehaviour(
&self,
ctx: &mut E,
client_id: &ClientId,
client_message: Any,
) -> Result<(), ClientError>
fn update_state_on_misbehaviour( &self, ctx: &mut E, client_id: &ClientId, client_message: Any, ) -> Result<(), ClientError>
Source§fn update_state_on_upgrade(
&self,
ctx: &mut E,
client_id: &ClientId,
upgraded_client_state: Any,
upgraded_consensus_state: Any,
) -> Result<Height, ClientError>
fn update_state_on_upgrade( &self, ctx: &mut E, client_id: &ClientId, upgraded_client_state: Any, upgraded_consensus_state: Any, ) -> Result<Height, ClientError>
Source§fn update_on_recovery(
&self,
ctx: &mut E,
subject_client_id: &ClientId,
substitute_client_state: Any,
substitute_consensus_state: Any,
) -> Result<(), ClientError>
fn update_on_recovery( &self, ctx: &mut E, subject_client_id: &ClientId, substitute_client_state: Any, substitute_consensus_state: Any, ) -> Result<(), ClientError>
substitute_client_state
in response
to a successful client recovery.Source§impl<V> ClientStateValidation<V> for ClientStatewhere
V: ExtClientValidationContext,
ConsensusState: Convertible<V::ConsensusStateRef>,
<ConsensusState as TryFrom<V::ConsensusStateRef>>::Error: Into<ClientError>,
impl<V> ClientStateValidation<V> for ClientStatewhere
V: ExtClientValidationContext,
ConsensusState: Convertible<V::ConsensusStateRef>,
<ConsensusState as TryFrom<V::ConsensusStateRef>>::Error: Into<ClientError>,
Source§fn 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>
The default verification logic exposed by ibc-rs simply delegates to a
standalone verify_client_message
function. This is to make it as
simple as possible for those who merely need the default
ProdVerifier
behaviour, as well as those who require custom
verification logic.
In a situation where the Tendermint ProdVerifier
doesn’t provide the
desired outcome, users should define a custom verifier struct and then
implement the Verifier
trait for it.
In order to wire up the custom verifier, create a newtype ClientState
wrapper similar to ClientState
and implement all client state traits
for it. For method implementation, the simplest way is to import and
call their analogous standalone versions under the
crate::client_state
module, unless bespoke logic is desired for any
of those functions. Then, when it comes to implementing the
verify_client_message
method, use the verify_client_message
function and pass your custom verifier object as the verifier
parameter.
Source§fn 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>
Source§fn status(&self, ctx: &V, client_id: &ClientId) -> Result<Status, ClientError>
fn status(&self, ctx: &V, client_id: &ClientId) -> Result<Status, ClientError>
Source§fn check_substitute(
&self,
_ctx: &V,
substitute_client_state: Any,
) -> Result<(), ClientError>
fn check_substitute( &self, _ctx: &V, substitute_client_state: Any, ) -> Result<(), ClientError>
Source§impl Clone for ClientState
impl Clone for ClientState
Source§fn clone(&self) -> ClientState
fn clone(&self) -> ClientState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ClientState
impl Debug for ClientState
Source§impl<'de> Deserialize<'de> for ClientState
impl<'de> Deserialize<'de> for ClientState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ClientState> for Any
impl From<ClientState> for Any
Source§fn from(client_state: ClientState) -> Self
fn from(client_state: ClientState) -> Self
Source§impl From<ClientState> for ClientState
impl From<ClientState> for ClientState
Source§fn from(value: ClientStateType) -> Self
fn from(value: ClientStateType) -> Self
Source§impl From<ClientState> for ClientState
impl From<ClientState> for ClientState
Source§fn from(client_state: ClientState) -> Self
fn from(client_state: ClientState) -> Self
Source§impl PartialEq for ClientState
impl PartialEq for ClientState
Source§impl Protobuf<Any> for ClientState
impl Protobuf<Any> for ClientState
Source§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Source§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Source§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Source§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Source§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
(or equivalent).Source§impl Protobuf<ClientState> for ClientState
impl Protobuf<ClientState> for ClientState
Source§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Source§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Source§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Source§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Source§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Vec<u8>
(or equivalent).