From 69dd94b72787cd5a37f7332eb2d7373ed2d561b2 Mon Sep 17 00:00:00 2001 From: yoshidan Date: Tue, 27 Feb 2024 22:41:04 +0900 Subject: [PATCH] trim left zero from expected value Signed-off-by: yoshidan --- crates/ibc/src/client_state.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/ibc/src/client_state.rs b/crates/ibc/src/client_state.rs index e93ca65..370f8d9 100644 --- a/crates/ibc/src/client_state.rs +++ b/crates/ibc/src/client_state.rs @@ -123,7 +123,7 @@ impl &[u8] { + let mut pos = 0; + for v in value { + if *v != 0 { + break; + } + pos += 1; + } + &value[pos..] +} + #[cfg(test)] mod tests { use super::*;