diff --git a/modules/src/clients/ics07_tendermint/client_def.rs b/modules/src/clients/ics07_tendermint/client_def.rs index 80eed2701f..df2f3d0fc0 100644 --- a/modules/src/clients/ics07_tendermint/client_def.rs +++ b/modules/src/clients/ics07_tendermint/client_def.rs @@ -208,7 +208,9 @@ impl ClientDef for TendermintClient { epoch: consensus_height.revision_number, height: consensus_height.revision_height, }; - let value = expected_consensus_state.encode_vec().unwrap(); + let value = expected_consensus_state + .encode_vec() + .map_err(Ics02Error::invalid_any_consensus_state)?; verify_membership(client_state, prefix, proof, root, path, value) } @@ -225,7 +227,9 @@ impl ClientDef for TendermintClient { client_state.verify_height(height)?; let path = ConnectionsPath(connection_id.clone()); - let value = expected_connection_end.encode_vec().unwrap(); + let value = expected_connection_end + .encode_vec() + .map_err(Ics02Error::invalid_connection_end)?; verify_membership(client_state, prefix, proof, root, path, value) } @@ -243,7 +247,9 @@ impl ClientDef for TendermintClient { client_state.verify_height(height)?; let path = ChannelEndsPath(port_id.clone(), *channel_id); - let value = expected_channel_end.encode_vec().unwrap(); + let value = expected_channel_end + .encode_vec() + .map_err(Ics02Error::invalid_channel_end)?; verify_membership(client_state, prefix, proof, root, path, value) } @@ -260,7 +266,9 @@ impl ClientDef for TendermintClient { client_state.verify_height(height)?; let path = ClientStatePath(client_id.clone()); - let value = expected_client_state.encode_vec().unwrap(); + let value = expected_client_state + .encode_vec() + .map_err(Ics02Error::invalid_any_client_state)?; verify_membership(client_state, prefix, proof, root, path, value) } diff --git a/modules/src/core/ics02_client/client_def.rs b/modules/src/core/ics02_client/client_def.rs index 3575a1661c..a00d3aa212 100644 --- a/modules/src/core/ics02_client/client_def.rs +++ b/modules/src/core/ics02_client/client_def.rs @@ -46,7 +46,7 @@ pub trait ClientDef: Clone { ) -> Result<(Self::ClientState, Self::ConsensusState), Error>; /// Verification functions as specified in: - /// + /// /// /// Verify a `proof` that the consensus state of a given client (at height `consensus_height`) /// matches the input `consensus_state`. The parameter `counterparty_height` represent the diff --git a/modules/src/core/ics02_client/error.rs b/modules/src/core/ics02_client/error.rs index 294f2a4f0d..810dc88f7f 100644 --- a/modules/src/core/ics02_client/error.rs +++ b/modules/src/core/ics02_client/error.rs @@ -253,6 +253,21 @@ define_error! { { height: Height } | e | { format_args!("the local consensus state could not be retrieved for height {}", e.height) }, + InvalidConnectionEnd + [ TraceError] + | _ | { "invalid connection end" }, + + InvalidChannelEnd + [ TraceError] + | _ | { "invalid channel end" }, + + InvalidAnyClientState + [ TraceError] + | _ | { "invalid any client state" }, + + InvalidAnyConsensusState + [ TraceError ] + | _ | { "invalid any client consensus state" }, } } diff --git a/modules/src/core/ics02_client/msgs.rs b/modules/src/core/ics02_client/msgs.rs index 020e79445a..3131be9beb 100644 --- a/modules/src/core/ics02_client/msgs.rs +++ b/modules/src/core/ics02_client/msgs.rs @@ -2,7 +2,7 @@ //! these messages can be found, for instance, in ICS 07 for Tendermint-specific chains. A chain //! handles these messages in two layers: first with the general ICS 02 client handler, which //! subsequently calls into the chain-specific (e.g., ICS 07) client handler. See: -//! . +//! . use crate::core::ics02_client::msgs::create_client::MsgCreateAnyClient; use crate::core::ics02_client::msgs::misbehavior::MsgSubmitAnyMisbehaviour; diff --git a/modules/src/core/ics03_connection/msgs.rs b/modules/src/core/ics03_connection/msgs.rs index 9fd860b365..ab2cbec661 100644 --- a/modules/src/core/ics03_connection/msgs.rs +++ b/modules/src/core/ics03_connection/msgs.rs @@ -2,7 +2,7 @@ //! //! We define each of the four messages in the connection handshake protocol as a `struct`. //! Each such message comprises the same fields as the datagrams defined in ICS3 English spec: -//! . +//! . //! //! One departure from ICS3 is that we abstract the three counterparty fields (connection id, //! prefix, and client id) into a single field of type `Counterparty`; this applies to messages diff --git a/modules/src/core/ics24_host/path.rs b/modules/src/core/ics24_host/path.rs index 262d75cb4e..56542e1d26 100644 --- a/modules/src/core/ics24_host/path.rs +++ b/modules/src/core/ics24_host/path.rs @@ -1,7 +1,7 @@ use crate::prelude::*; /// Path-space as listed in ICS-024 -/// https://github.com/cosmos/ibc/tree/master/spec/ics-024-host-requirements#path-space +/// https://github.com/cosmos/ibc/tree/master/spec/core/ics-024-host-requirements#path-space /// Some of these are implemented in other ICSs, but ICS-024 has a nice summary table. /// use core::str::FromStr;