Skip to content

Commit

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

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

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

0 comments on commit b0d3943

Please sign in to comment.