From d994465c166656ea8d8fb190137409d20de0fda3 Mon Sep 17 00:00:00 2001 From: Kevin Ji <1146876+kevinji@users.noreply.github.com> Date: Mon, 6 Mar 2023 05:46:27 -0800 Subject: [PATCH] Derive `Hash` on `tendermint::Time` again (#1278) This reintroduces #1054 after it was removed in #1203. --- .changelog/unreleased/improvements/1278-re-add-hash-on-time.md | 2 ++ tendermint/src/time.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .changelog/unreleased/improvements/1278-re-add-hash-on-time.md diff --git a/.changelog/unreleased/improvements/1278-re-add-hash-on-time.md b/.changelog/unreleased/improvements/1278-re-add-hash-on-time.md new file mode 100644 index 000000000..e37c89c5d --- /dev/null +++ b/.changelog/unreleased/improvements/1278-re-add-hash-on-time.md @@ -0,0 +1,2 @@ +- Derive `Hash` on `tendermint::Time` + ([#1278](https://github.com/informalsystems/tendermint-rs/issues/1278)) \ No newline at end of file diff --git a/tendermint/src/time.rs b/tendermint/src/time.rs index e57dd5388..443f5d7cd 100644 --- a/tendermint/src/time.rs +++ b/tendermint/src/time.rs @@ -34,7 +34,7 @@ use crate::{error::Error, prelude::*}; // For memory efficiency, the inner member is `PrimitiveDateTime`, with assumed // UTC offset. The `assume_utc` method is used to get the operational // `OffsetDateTime` value. -#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord, Serialize, Deserialize)] #[serde(try_from = "Timestamp", into = "Timestamp")] pub struct Time(PrimitiveDateTime);