pub enum AnyClientState {
Tendermint(ClientState),
Mock(MockClientState),
}Variants§
Tendermint(ClientState)
Mock(MockClientState)
Implementations§
Trait Implementations§
Source§impl ClientStateCommon for AnyClientState
impl ClientStateCommon for AnyClientState
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>
Performs basic validation on the
consensus_state. Read moreSource§fn client_type(&self) -> ClientType
fn client_type(&self) -> ClientType
Type of client associated with this state (eg. Tendermint)
Source§fn latest_height(&self) -> Height
fn latest_height(&self) -> Height
The latest height the client was updated to
Source§fn validate_proof_height(&self, proof_height: Height) -> Result<(), ClientError>
fn validate_proof_height(&self, proof_height: Height) -> Result<(), ClientError>
Validate that the client is at a sufficient height
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>
Verify the upgraded client and consensus states and validate proofs
against the given root. Read more
Source§fn serialize_path(&self, path: Path) -> Result<PathBytes, ClientError>
fn serialize_path(&self, path: Path) -> Result<PathBytes, ClientError>
Serializes a given path object into a raw path bytes. Read more
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>
Verifies a proof of the existence of a value at a given raw path bytes.
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>
Verifies a proof of the existence of a value at a given path object.
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>
Verifies the absence of a given proof at a given raw path bytes.
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>
Verifies the absence of a given proof at a given path object.
Source§impl<S> ClientStateExecution<MockIbcStore<S>> for AnyClientStatewhere
S: ProvableStore + Debug,
impl<S> ClientStateExecution<MockIbcStore<S>> for AnyClientStatewhere
S: ProvableStore + Debug,
Source§fn initialise(
&self,
ctx: &mut MockIbcStore<S>,
client_id: &ClientId,
consensus_state: Any,
) -> Result<(), ClientError>
fn initialise( &self, ctx: &mut MockIbcStore<S>, client_id: &ClientId, consensus_state: Any, ) -> Result<(), ClientError>
Initialises the client with the initial client and consensus states. Read more
Source§fn update_state(
&self,
ctx: &mut MockIbcStore<S>,
client_id: &ClientId,
header: Any,
) -> Result<Vec<Height>, ClientError>
fn update_state( &self, ctx: &mut MockIbcStore<S>, client_id: &ClientId, header: Any, ) -> Result<Vec<Height>, ClientError>
Updates and stores as necessary any associated information for an IBC
client, such as the ClientState and corresponding ConsensusState. Upon
successful update, a list of consensus heights is returned. It assumes
the client_message has already been verified. Read more
Source§fn update_state_on_misbehaviour(
&self,
ctx: &mut MockIbcStore<S>,
client_id: &ClientId,
client_message: Any,
) -> Result<(), ClientError>
fn update_state_on_misbehaviour( &self, ctx: &mut MockIbcStore<S>, client_id: &ClientId, client_message: Any, ) -> Result<(), ClientError>
update_state_on_misbehaviour should perform appropriate state changes on
a client state given that misbehaviour has been detected and verified
Source§fn update_state_on_upgrade(
&self,
ctx: &mut MockIbcStore<S>,
client_id: &ClientId,
upgraded_client_state: Any,
upgraded_consensus_state: Any,
) -> Result<Height, ClientError>
fn update_state_on_upgrade( &self, ctx: &mut MockIbcStore<S>, client_id: &ClientId, upgraded_client_state: Any, upgraded_consensus_state: Any, ) -> Result<Height, ClientError>
Update the client state and consensus state in the store with the upgraded ones.
Source§fn update_on_recovery(
&self,
ctx: &mut MockIbcStore<S>,
client_id: &ClientId,
substitute_client_state: Any,
substitute_consensus_state: Any,
) -> Result<(), ClientError>
fn update_on_recovery( &self, ctx: &mut MockIbcStore<S>, client_id: &ClientId, substitute_client_state: Any, substitute_consensus_state: Any, ) -> Result<(), ClientError>
Update the subject client using the
substitute_client_state in response
to a successful client recovery.Source§impl<S> ClientStateValidation<MockIbcStore<S>> for AnyClientStatewhere
S: ProvableStore + Debug,
impl<S> ClientStateValidation<MockIbcStore<S>> for AnyClientStatewhere
S: ProvableStore + Debug,
Source§fn verify_client_message(
&self,
ctx: &MockIbcStore<S>,
client_id: &ClientId,
client_message: Any,
) -> Result<(), ClientError>
fn verify_client_message( &self, ctx: &MockIbcStore<S>, 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.
Source§fn check_for_misbehaviour(
&self,
ctx: &MockIbcStore<S>,
client_id: &ClientId,
client_message: Any,
) -> Result<bool, ClientError>
fn check_for_misbehaviour( &self, ctx: &MockIbcStore<S>, 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.
Source§fn status(
&self,
ctx: &MockIbcStore<S>,
client_id: &ClientId,
) -> Result<Status, ClientError>
fn status( &self, ctx: &MockIbcStore<S>, client_id: &ClientId, ) -> Result<Status, ClientError>
Returns the status of the client. Only Active clients are allowed to process packets.
Source§fn check_substitute(
&self,
ctx: &MockIbcStore<S>,
substitute_client_state: Any,
) -> Result<(), ClientError>
fn check_substitute( &self, ctx: &MockIbcStore<S>, substitute_client_state: Any, ) -> Result<(), ClientError>
Verifies whether the calling (subject) client state matches the substitute
client state for the purposes of client recovery. Read more
Source§impl Clone for AnyClientState
impl Clone for AnyClientState
Source§fn clone(&self) -> AnyClientState
fn clone(&self) -> AnyClientState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnyClientState
impl Debug for AnyClientState
Source§impl From<AnyClientState> for Any
impl From<AnyClientState> for Any
Source§fn from(host_client_state: AnyClientState) -> Self
fn from(host_client_state: AnyClientState) -> Self
Converts to this type from the input type.
Source§impl From<ClientState> for AnyClientState
impl From<ClientState> for AnyClientState
Source§fn from(value: TmClientState) -> Self
fn from(value: TmClientState) -> Self
Converts to this type from the input type.
Source§impl From<ClientState> for AnyClientState
impl From<ClientState> for AnyClientState
Source§fn from(client_state: ClientStateType) -> Self
fn from(client_state: ClientStateType) -> Self
Converts to this type from the input type.
Source§impl From<MockClientState> for AnyClientState
impl From<MockClientState> for AnyClientState
Source§fn from(value: MockClientState) -> Self
fn from(value: MockClientState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AnyClientState
impl PartialEq for AnyClientState
Source§impl Protobuf<Any> for AnyClientState
impl Protobuf<Any> for AnyClientState
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,
Encode into a buffer in Protobuf format. Read more
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,
Encode with a length-delimiter to a buffer in Protobuf format. Read more
Source§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode an instance from a buffer. Read more
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,
Constructor that attempts to decode a length-delimited instance from
the buffer. Read more
Source§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Returns the encoded length of the message without a length delimiter. Read more
Source§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8> (or equivalent).Source§impl TryFrom<Any> for AnyClientState
impl TryFrom<Any> for AnyClientState
impl StructuralPartialEq for AnyClientState
Auto Trait Implementations§
impl Freeze for AnyClientState
impl RefUnwindSafe for AnyClientState
impl Send for AnyClientState
impl Sync for AnyClientState
impl Unpin for AnyClientState
impl UnwindSafe for AnyClientState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request