From: Alec Chen Date: Sun, 23 Apr 2023 04:04:26 +0000 (-0500) Subject: Add `PartialOrd`, `Ord` to `PaymentHash`, `PaymentPreimage` for tests X-Git-Tag: v0.0.116-alpha1~61^2~4 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=53c79711b4c6ecc9715463398ec8c5e1c4806ffc;p=rust-lightning Add `PartialOrd`, `Ord` to `PaymentHash`, `PaymentPreimage` for tests --- diff --git a/lightning/src/ln/mod.rs b/lightning/src/ln/mod.rs index 340213c51..3a0efd386 100644 --- a/lightning/src/ln/mod.rs +++ b/lightning/src/ln/mod.rs @@ -73,11 +73,13 @@ pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN; /// /// This is not exported to bindings users as we just use [u8; 32] directly #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)] +#[cfg_attr(test, derive(PartialOrd, Ord))] pub struct PaymentHash(pub [u8; 32]); /// payment_preimage type, use to route payment between hop /// /// This is not exported to bindings users as we just use [u8; 32] directly #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)] +#[cfg_attr(test, derive(PartialOrd, Ord))] pub struct PaymentPreimage(pub [u8; 32]); /// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together ///