Skip to content

Commit

Permalink
use expect over comment for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Apr 30, 2024
1 parent 8d47a2a commit 20dd42c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibc-testkit/src/testapp/ibc/core/client_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ where
) -> Result<Option<Self::ConsensusStateRef>, ContextError> {
let path = format!("clients/{client_id}/consensusStates")
.try_into()
.unwrap(); // safety - path must be valid since ClientId and height are valid Identifiers
.expect("Must be valid path: ClientId and height are valid Identifiers");

let keys = self.store.get_keys(&path);
let found_path = keys.into_iter().find_map(|path| {
Expand Down Expand Up @@ -127,7 +127,7 @@ where
) -> Result<Option<Self::ConsensusStateRef>, ContextError> {
let path = format!("clients/{client_id}/consensusStates")
.try_into()
.unwrap(); // safety - path must be valid since ClientId and height are valid Identifiers
.expect("Must be valid path: ClientId and height are valid Identifiers");

let keys = self.store.get_keys(&path);
let found_path = keys.into_iter().rev().find_map(|path| {
Expand Down

0 comments on commit 20dd42c

Please sign in to comment.