Add derives where they make sense and the bindings require them
authorMatt Corallo <git@bluematt.me>
Wed, 1 May 2024 15:18:29 +0000 (15:18 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 1 May 2024 16:04:37 +0000 (16:04 +0000)
lightning/src/blinded_path/mod.rs
lightning/src/onion_message/messenger.rs
lightning/src/onion_message/packet.rs

index 3b4eac883646da74c7aa886066632840b622894d..3dc6b121b006b80f95f05bfb59f23a5ff0764b98 100644 (file)
@@ -27,7 +27,7 @@ use crate::prelude::*;
 /// The next hop to forward an onion message along its path.
 ///
 /// Note that payment blinded paths always specify their next hop using an explicit node id.
-#[derive(Debug)]
+#[derive(Clone, Debug, Hash, PartialEq, Eq)]
 pub enum NextMessageHop {
        /// The node id of the next hop.
        NodeId(PublicKey),
index 8fbcb5877d8d7f60108b4a3239d7c44f00e37b22..476655ebeb8becd9350e7d0470f49235999d3a8a 100644 (file)
@@ -569,7 +569,7 @@ pub trait CustomOnionMessageHandler {
 
 /// A processed incoming onion message, containing either a Forward (another onion message)
 /// or a Receive payload with decrypted contents.
-#[derive(Debug)]
+#[derive(Clone, Debug)]
 pub enum PeeledOnion<T: OnionMessageContents> {
        /// Forwarded onion, with the next node id and a new onion
        Forward(NextMessageHop, OnionMessage),
index e1054c5dbe1886a10aa7deb447908e52cbee5325..deda1acb7e95e86950e951ca040003e14f79d4dd 100644 (file)
@@ -117,7 +117,7 @@ pub(super) enum Payload<T: OnionMessageContents> {
 /// The contents of an [`OnionMessage`] as read from the wire.
 ///
 /// [`OnionMessage`]: crate::ln::msgs::OnionMessage
-#[derive(Debug)]
+#[derive(Clone, Debug)]
 pub enum ParsedOnionMessageContents<T: OnionMessageContents> {
        /// A message related to BOLT 12 Offers.
        Offers(OffersMessage),