Skip to content

Commit

Permalink
fix is_wasm_client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Jun 5, 2024
1 parent c8c97fc commit 974ed8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ibc-core/ics24-host/types/src/identifiers/client_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ impl ClientId {

/// Check if the client identifier is for 08-wasm light client.
pub fn is_wasm_client_id(&self) -> bool {
// prefixed with wasm client type identifier.
self.0.starts_with("08-wasm-")
// followed by a number.
&& self.0.len() > "08-wasm-".len()
// and the rest of the string is numeric.
&& self.0.chars().skip("08-wasm-".len()).all(char::is_numeric)
}
}
Expand Down

0 comments on commit 974ed8d

Please sign in to comment.