Skip to content

Commit 0995de7

Browse files
authored
Merge pull request #2892 from TheBlueMatt/2024-02-destination-eq
Add further standard derives to various onion message structs
2 parents 0c2a715 + 6f02025 commit 0995de7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lightning/src/onion_message/messenger.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ impl OnionMessagePath {
413413
}
414414

415415
/// The destination of an onion message.
416-
#[derive(Clone, Debug, PartialEq, Eq)]
416+
#[derive(Clone, Hash, Debug, PartialEq, Eq)]
417417
pub enum Destination {
418418
/// We're sending this onion message to a node.
419419
Node(PublicKey),
@@ -440,7 +440,7 @@ impl Destination {
440440
/// Result of successfully [sending an onion message].
441441
///
442442
/// [sending an onion message]: OnionMessenger::send_onion_message
443-
#[derive(Debug, PartialEq, Eq)]
443+
#[derive(Clone, Hash, Debug, PartialEq, Eq)]
444444
pub enum SendSuccess {
445445
/// The message was buffered and will be sent once it is processed by
446446
/// [`OnionMessageHandler::next_onion_message_for_peer`].
@@ -453,7 +453,7 @@ pub enum SendSuccess {
453453
/// Errors that may occur when [sending an onion message].
454454
///
455455
/// [sending an onion message]: OnionMessenger::send_onion_message
456-
#[derive(Debug, PartialEq, Eq)]
456+
#[derive(Clone, Hash, Debug, PartialEq, Eq)]
457457
pub enum SendError {
458458
/// Errored computing onion message packet keys.
459459
Secp256k1(secp256k1::Error),
@@ -523,6 +523,7 @@ pub trait CustomOnionMessageHandler {
523523

524524
/// A processed incoming onion message, containing either a Forward (another onion message)
525525
/// or a Receive payload with decrypted contents.
526+
#[derive(Debug)]
526527
pub enum PeeledOnion<T: OnionMessageContents> {
527528
/// Forwarded onion, with the next node id and a new onion
528529
Forward(PublicKey, OnionMessage),

0 commit comments

Comments
 (0)