From fb4da9a53f53103830dec3215fb80360623027bb Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Sat, 4 May 2024 11:08:11 -0600 Subject: [PATCH] add `PartialOrd`, `Ord` to some types --- Cargo.toml | 2 +- ethereum-consensus/src/crypto.rs | 11 ++++++++++- ethereum-consensus/src/ssz/byte_vector.rs | 12 +++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f89aa36c..3430b2ed7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ serde_yaml = "0.8" itertools = "0.10.3" thiserror = "1.0.30" hex = "0.4.3" -ssz_rs = { git = "https://github.com/ralexstokes/ssz-rs", rev = "52cf0426922df94c0cb45a4736032d772c0a744f" } +ssz_rs = { git = "https://github.com/ralexstokes/ssz-rs", rev = "84ef2b71aa004f6767420badb42c902ad56b8b72" } blst = "0.3.11" rand = "0.8.4" sha2 = "0.10.8" diff --git a/ethereum-consensus/src/crypto.rs b/ethereum-consensus/src/crypto.rs index 77bfe7c05..a57dc9ccf 100644 --- a/ethereum-consensus/src/crypto.rs +++ b/ethereum-consensus/src/crypto.rs @@ -225,7 +225,16 @@ impl SecretKey { } #[derive( - Clone, Default, Hash, PartialEq, Eq, SimpleSerialize, serde::Serialize, serde::Deserialize, + Clone, + Default, + Hash, + PartialEq, + Eq, + PartialOrd, + Ord, + SimpleSerialize, + serde::Serialize, + serde::Deserialize, )] pub struct PublicKey(ByteVector); diff --git a/ethereum-consensus/src/ssz/byte_vector.rs b/ethereum-consensus/src/ssz/byte_vector.rs index bf5f7329c..6af19d166 100644 --- a/ethereum-consensus/src/ssz/byte_vector.rs +++ b/ethereum-consensus/src/ssz/byte_vector.rs @@ -8,7 +8,17 @@ use std::{ ops::{Deref, DerefMut}, }; -#[derive(Default, Clone, PartialEq, Eq, SimpleSerialize, serde::Serialize, serde::Deserialize)] +#[derive( + Default, + Clone, + PartialEq, + Eq, + PartialOrd, + Ord, + SimpleSerialize, + serde::Serialize, + serde::Deserialize, +)] pub struct ByteVector(#[serde(with = "crate::serde::as_hex")] Vector); impl TryFrom<&[u8]> for ByteVector {