Add `PartialOrd`, `Ord` to `PaymentHash`, `PaymentPreimage` for tests
authorAlec Chen <alecchendev@gmail.com>
Sun, 23 Apr 2023 04:04:26 +0000 (23:04 -0500)
committerAlec Chen <alecchendev@gmail.com>
Sun, 23 Apr 2023 04:04:29 +0000 (23:04 -0500)
lightning/src/ln/mod.rs

index 340213c515070aa719de95cef2e062e5c82158bc..3a0efd38690946cd5a7f48da324449d52f13fe2c 100644 (file)
@@ -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
 ///