Skip to content

Commit

Permalink
fix: apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Sep 25, 2024
1 parent a4bc6a2 commit 4f11258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ibc-primitives/src/types/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ impl scale_info::TypeInfo for Timestamp {

#[derive(Debug, Display, derive_more::From)]
pub enum TimestampError {
/// failed to parse integer error: {0}
/// failed to parse integer: {0}
FailedToParseInt(ParseIntError),
/// failed try from integer error: {0}
/// failed try_from on integer: {0}
FailedTryFromInt(TryFromIntError),
/// failed to convert offset date: {0}
FailedToConvert(time::error::ComponentRange),
Expand All @@ -303,6 +303,7 @@ impl std::error::Error for TimestampError {
match &self {
Self::FailedToParseInt(e) => Some(e),
Self::FailedTryFromInt(e) => Some(e),
Self::FailedToConvert(e) => Some(e),

Check warning on line 306 in ibc-primitives/src/types/timestamp.rs

View check run for this annotation

Codecov / codecov/patch

ibc-primitives/src/types/timestamp.rs#L304-L306

Added lines #L304 - L306 were not covered by tests
_ => None,
}
}
Expand Down
4 changes: 1 addition & 3 deletions ibc-testkit/src/testapp/ibc/core/core_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ where
let host_cons_state = self.host_consensus_state(&host_height)?;
let timestamp = host_cons_state
.timestamp()
.map_err(|e| HostError::InvalidState {
description: e.to_string(),
})?;
.map_err(HostError::invalid_state)?;
Ok(timestamp)
}

Expand Down

0 comments on commit 4f11258

Please sign in to comment.