diff --git a/ibc-clients/ics07-tendermint/src/client_state/common.rs b/ibc-clients/ics07-tendermint/src/client_state/common.rs index 5c573135f..ca0a82eec 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/common.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/common.rs @@ -66,10 +66,7 @@ impl ClientStateCommon for ClientState { let upgrade_path = &self.inner().upgrade_path; let (upgrade_path_prefix, upgrade_path) = match upgrade_path.len() { 0 => { - return Err(UpgradeClientError::InvalidUpgradePath { - description: "no upgrade path has been set".to_string(), - } - .into()); + return Err(UpgradeClientError::MissingUpgradePath.into()); } 1 => (CommitmentPrefix::empty(), upgrade_path[0].clone()), 2 => ( diff --git a/ibc-core/ics02-client/types/src/error.rs b/ibc-core/ics02-client/types/src/error.rs index 5fed54576..505ce8322 100644 --- a/ibc-core/ics02-client/types/src/error.rs +++ b/ibc-core/ics02-client/types/src/error.rs @@ -138,6 +138,8 @@ pub enum UpgradeClientError { InvalidUpgradeProposal { description: String }, /// invalid upgrade plan: `{description}` InvalidUpgradePlan { description: String }, + /// missing upgrade path + MissingUpgradePath, /// missing upgraded client state MissingUpgradedClientState, /// missing upgraded consensus state diff --git a/ibc-core/ics24-host/cosmos/src/upgrade_proposal/proposal.rs b/ibc-core/ics24-host/cosmos/src/upgrade_proposal/proposal.rs index 4a72af753..f069e6852 100644 --- a/ibc-core/ics24-host/cosmos/src/upgrade_proposal/proposal.rs +++ b/ibc-core/ics24-host/cosmos/src/upgrade_proposal/proposal.rs @@ -33,13 +33,13 @@ impl TryFrom for UpgradeProposal { fn try_from(raw: RawUpgradeProposal) -> Result { if raw.title.is_empty() { return Err(UpgradeClientError::InvalidUpgradeProposal { - description: "title field cannot be empty".to_string(), + description: "missing title field".to_string(), }); } if raw.description.is_empty() { return Err(UpgradeClientError::InvalidUpgradeProposal { - description: "description field cannot be empty".to_string(), + description: "missing description field".to_string(), }); } @@ -47,13 +47,13 @@ impl TryFrom for UpgradeProposal { plan.try_into()? } else { return Err(UpgradeClientError::InvalidUpgradeProposal { - description: "plan field cannot be empty".to_string(), + description: "missing plan field".to_string(), }); }; let upgraded_client_state = raw.upgraded_client_state.ok_or_else(|| { UpgradeClientError::InvalidUpgradeProposal { - description: "upgraded client state cannot be empty".to_string(), + description: "missing upgraded client state".to_string(), } })?; diff --git a/ibc-primitives/src/lib.rs b/ibc-primitives/src/lib.rs index 8de7a3d39..277c794cd 100644 --- a/ibc-primitives/src/lib.rs +++ b/ibc-primitives/src/lib.rs @@ -32,6 +32,5 @@ pub mod serializers; pub mod proto { pub use ibc_proto::google::protobuf::{Any, Duration, Timestamp}; - pub use ibc_proto::Error; - pub use ibc_proto::Protobuf; + pub use ibc_proto::{Error, Protobuf}; }