From ebf30194db5a073eb96c834d7466a5818548d2b8 Mon Sep 17 00:00:00 2001 From: Ranadeep Biswas Date: Fri, 2 Feb 2024 10:54:38 +0100 Subject: [PATCH] rm unused utils and deps --- ibc-testkit/Cargo.toml | 1 - ibc-testkit/src/testapp/ibc/utils.rs | 30 ---------------------------- 2 files changed, 31 deletions(-) diff --git a/ibc-testkit/Cargo.toml b/ibc-testkit/Cargo.toml index 4d9619576..2008e2316 100644 --- a/ibc-testkit/Cargo.toml +++ b/ibc-testkit/Cargo.toml @@ -37,7 +37,6 @@ basecoin-store = { git = "https://github.com/informalsystems/basecoin-rs", rev = # cosmos dependencies tendermint = { workspace = true } tendermint-testgen = { workspace = true } -tendermint-proto = { workspace = true } [dev-dependencies] env_logger = "0.11.0" diff --git a/ibc-testkit/src/testapp/ibc/utils.rs b/ibc-testkit/src/testapp/ibc/utils.rs index d4e86321c..d5032cae1 100644 --- a/ibc-testkit/src/testapp/ibc/utils.rs +++ b/ibc-testkit/src/testapp/ibc/utils.rs @@ -1,34 +1,4 @@ -use core::time::Duration; - use ibc::core::client::types::Height; -use ibc::primitives::Timestamp; -use ibc_proto::google::protobuf::{Duration as GDuration, Timestamp as GTimestamp}; - -pub fn timestamp_gpb_to_ibc(gpb_timestamp: GTimestamp) -> Timestamp { - let GTimestamp { seconds, nanos } = gpb_timestamp; - Timestamp::from_nanoseconds(seconds as u64 * 1_000_000_000 + nanos as u64) - .expect("no hmm overflow") -} - -pub fn timestamp_ibc_to_gpb(ibc_timestamp: Timestamp) -> GTimestamp { - let tendermint_proto::google::protobuf::Timestamp { seconds, nanos } = ibc_timestamp - .into_tm_time() - .unwrap_or_else(|| tendermint::Time::from_unix_timestamp(0, 0).expect("no overflow")) - .into(); - GTimestamp { seconds, nanos } -} - -pub fn duration_gpb_to_ibc(gbp_duration: GDuration) -> Duration { - let GDuration { seconds, nanos } = gbp_duration; - Duration::from_nanos(seconds as u64 * 1_000_000_000 + nanos as u64) -} - -pub fn duration_ibc_to_gbp(ibc_duration: Duration) -> GDuration { - GDuration { - seconds: ibc_duration.as_secs() as i64, - nanos: ibc_duration.subsec_nanos() as i32, - } -} pub fn blocks_since(a: Height, b: Height) -> Option { (a.revision_number() == b.revision_number() && a.revision_height() >= b.revision_height())