From 8259825d645f36ec383780e737bedb174c4a34a3 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Sun, 25 Aug 2024 10:02:33 -0600 Subject: [PATCH] zcash_protocol: Remove impl {Add, Sub} for BlockHeight These operations are unused, and block heights form a vector space, not a monoid. --- components/zcash_protocol/CHANGELOG.md | 4 ++++ components/zcash_protocol/src/consensus.rs | 16 ---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/components/zcash_protocol/CHANGELOG.md b/components/zcash_protocol/CHANGELOG.md index 45df906538..e9f8e85647 100644 --- a/components/zcash_protocol/CHANGELOG.md +++ b/components/zcash_protocol/CHANGELOG.md @@ -7,6 +7,10 @@ and this library adheres to Rust's notion of ## [Unreleased] +### Removed +- `impl {Add, Sub} for BlockHeight` - these operations were unused, and block + heights are a vector space, not a monoid. + ## [0.2.0] - 2024-08-19 ### Added - `zcash_protocol::PoolType::{TRANSPARENT, SAPLING, ORCHARD}` diff --git a/components/zcash_protocol/src/consensus.rs b/components/zcash_protocol/src/consensus.rs index 0ad1d04e11..c034da519b 100644 --- a/components/zcash_protocol/src/consensus.rs +++ b/components/zcash_protocol/src/consensus.rs @@ -107,14 +107,6 @@ impl Add for BlockHeight { } } -impl Add for BlockHeight { - type Output = Self; - - fn add(self, other: Self) -> Self { - self + other.0 - } -} - impl Sub for BlockHeight { type Output = Self; @@ -127,14 +119,6 @@ impl Sub for BlockHeight { } } -impl Sub for BlockHeight { - type Output = Self; - - fn sub(self, other: Self) -> Self { - self - other.0 - } -} - /// Constants associated with a given Zcash network. pub trait NetworkConstants: Clone { /// The coin type for ZEC, as defined by [SLIP 44].