pub enum AnyClientState {
    Tendermint(ClientState),
    Mock(MockClientState),
}

Variants§

§

Tendermint(ClientState)

§

Mock(MockClientState)

Trait Implementations§

source§

impl ClientStateCommon for AnyClientState

source§

fn verify_consensus_state( &self, consensus_state: Any ) -> Result<(), ClientError>

Performs basic validation on the consensus_state. Read more
source§

fn client_type(&self) -> ClientType

Type of client associated with this state (eg. Tendermint)
source§

fn latest_height(&self) -> Height

Latest height the client was updated to
source§

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>

Verify the upgraded client and consensus states and validate proofs against the given root. Read more
source§

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>

source§

impl ClientStateExecution<MockContext> for AnyClientState

source§

fn initialise( &self, ctx: &mut MockContext, 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 MockContext, 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 MockContext, client_id: &ClientId, client_message: Any, update_kind: &UpdateKind ) -> 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 MockContext, client_id: &ClientId, upgraded_client_state: Any, upgraded_consensus_state: Any ) -> Result<Height, ClientError>

source§

impl ClientStateValidation<MockContext> for AnyClientState

source§

fn verify_client_message( &self, ctx: &MockContext, client_id: &ClientId, client_message: Any, update_kind: &UpdateKind ) -> 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: &MockContext, client_id: &ClientId, client_message: Any, update_kind: &UpdateKind ) -> 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: &MockContext, client_id: &ClientId ) -> Result<Status, ClientError>

Returns the status of the client. Only Active clients are allowed to process packets.
source§

impl Clone for AnyClientState

source§

fn clone(&self) -> AnyClientState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AnyClientState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<AnyClientState> for Any

source§

fn from(host_client_state: AnyClientState) -> Self

Converts to this type from the input type.
source§

impl From<ClientState> for AnyClientState

source§

fn from(original: TmClientState) -> AnyClientState

Converts to this type from the input type.
source§

impl From<MockClientState> for AnyClientState

source§

fn from(original: MockClientState) -> AnyClientState

Converts to this type from the input type.
source§

impl PartialEq for AnyClientState

source§

fn eq(&self, other: &AnyClientState) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Protobuf<Any> for AnyClientState

§

fn encode<B>(self, buf: &mut B) -> Result<(), Error>where B: BufMut,

Encode into a buffer in Protobuf format. Read more
§

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
§

fn decode<B>(buf: B) -> Result<Self, Error>where B: Buf,

Constructor that attempts to decode an instance from a buffer. Read more
§

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
§

fn encoded_len(self) -> usize

Returns the encoded length of the message without a length delimiter. Read more
§

fn encode_vec(self) -> Vec<u8>

Encodes into a Protobuf-encoded Vec<u8>.
§

fn decode_vec(v: &[u8]) -> Result<Self, Error>

Constructor that attempts to decode a Protobuf-encoded instance from a Vec<u8> (or equivalent).
§

fn encode_length_delimited_vec(self) -> Vec<u8>

Encode with a length-delimiter to a Vec<u8> Protobuf-encoded message.
§

fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>

Constructor that attempts to decode a Protobuf-encoded instance with a length-delimiter from a Vec<u8> or equivalent.
source§

impl TryFrom<Any> for AnyClientState

§

type Error = ClientError

The type returned in the event of a conversion error.
source§

fn try_from(raw: Any) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl StructuralPartialEq for AnyClientState

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<V, E, T> ClientState<V, E> for Twhere V: ClientValidationContext, E: ClientExecutionContext, T: Send + Sync + ClientStateCommon + ClientStateValidation<V> + ClientStateExecution<E>,