projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71c0d56
)
Add further standard derives to various onion message structs
2024-02-destination-eq
author
Matt Corallo
<git@bluematt.me>
Mon, 12 Feb 2024 23:54:14 +0000
(23:54 +0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 12 Feb 2024 23:54:14 +0000
(23:54 +0000)
lightning/src/onion_message/messenger.rs
patch
|
blob
|
history
diff --git
a/lightning/src/onion_message/messenger.rs
b/lightning/src/onion_message/messenger.rs
index 0a38022dbb5883cdcf06a5e3340a68079ae9f23c..2dc5a89a37b5fae41071d8c4589d813b39916a3e 100644
(file)
--- a/
lightning/src/onion_message/messenger.rs
+++ b/
lightning/src/onion_message/messenger.rs
@@
-413,7
+413,7
@@
impl OnionMessagePath {
}
/// The destination of an onion message.
}
/// The destination of an onion message.
-#[derive(Clone, Debug, PartialEq, Eq)]
+#[derive(Clone,
Hash,
Debug, PartialEq, Eq)]
pub enum Destination {
/// We're sending this onion message to a node.
Node(PublicKey),
pub enum Destination {
/// We're sending this onion message to a node.
Node(PublicKey),
@@
-440,7
+440,7
@@
impl Destination {
/// Result of successfully [sending an onion message].
///
/// [sending an onion message]: OnionMessenger::send_onion_message
/// Result of successfully [sending an onion message].
///
/// [sending an onion message]: OnionMessenger::send_onion_message
-#[derive(Debug, PartialEq, Eq)]
+#[derive(
Clone, Hash,
Debug, PartialEq, Eq)]
pub enum SendSuccess {
/// The message was buffered and will be sent once it is processed by
/// [`OnionMessageHandler::next_onion_message_for_peer`].
pub enum SendSuccess {
/// The message was buffered and will be sent once it is processed by
/// [`OnionMessageHandler::next_onion_message_for_peer`].
@@
-453,7
+453,7
@@
pub enum SendSuccess {
/// Errors that may occur when [sending an onion message].
///
/// [sending an onion message]: OnionMessenger::send_onion_message
/// Errors that may occur when [sending an onion message].
///
/// [sending an onion message]: OnionMessenger::send_onion_message
-#[derive(Debug, PartialEq, Eq)]
+#[derive(
Clone, Hash,
Debug, PartialEq, Eq)]
pub enum SendError {
/// Errored computing onion message packet keys.
Secp256k1(secp256k1::Error),
pub enum SendError {
/// Errored computing onion message packet keys.
Secp256k1(secp256k1::Error),
@@
-523,6
+523,7
@@
pub trait CustomOnionMessageHandler {
/// A processed incoming onion message, containing either a Forward (another onion message)
/// or a Receive payload with decrypted contents.
/// A processed incoming onion message, containing either a Forward (another onion message)
/// or a Receive payload with decrypted contents.
+#[derive(Debug)]
pub enum PeeledOnion<T: OnionMessageContents> {
/// Forwarded onion, with the next node id and a new onion
Forward(PublicKey, OnionMessage),
pub enum PeeledOnion<T: OnionMessageContents> {
/// Forwarded onion, with the next node id and a new onion
Forward(PublicKey, OnionMessage),