Conversation
|
||
/// Type of message. | ||
/// Note this is part of this crate's public API but this enum is | ||
/// never serialised or even part of the message that is sent over the wire. | ||
#[derive(PartialEq, Debug)] | ||
#[derive(PartialEq, Debug, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be careful deriving Clone on types that can be very large. IMO it's best if we avoid this as much as possible so we are naturally careful with .clone()
.
pub fn src_section_pk(&self) -> Option<PublicKey> { | ||
self.src_section_pk | ||
} | ||
|
||
// Parses the provided bytes to deserialize a WireMsgHeader, | ||
// returning the created WireMsgHeader, as well as the remaining bytes which | ||
// correspond to the message payload. The caller shall then take care of | ||
// deserializing the payload using the information provided in the WireMsgHeader. | ||
pub fn from(mut bytes: Bytes) -> Result<(Self, Bytes)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best to keep this function definition consistent with the From
trait and rename this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably go into it's own PR. Maybe there's a bunch of things like this that can be done all in one go.
2113366
to
2c42284
Compare
This reverts commit 158e3a3.
- Relocating NodeCmd messages into the node module. - Temporarily have a variant length wire message header, to accomodate the src section public key as optional for some of the NodeCmd messages.
…eserialise NodeCmdMessages
- Also removes some repitition.
8a8eb69
to
4eac2f1
Compare
- Outdated since section wallets are no longer used.
No description provided.