Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
chore: add missing snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
oetyng committed May 8, 2021
1 parent d413ae6 commit d2b860e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ impl SupportingInfo {
Self {
info,
source_message,
correlation_id,
id,
correlation_id,
}
}

Expand Down Expand Up @@ -126,7 +126,7 @@ impl SupportingInfo {
#[allow(clippy::large_enum_variant)]
#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
pub struct ProcessingError {
/// Optional reason for the error. This should help receiving node handle the error
/// Optional reason for the error. This should help the receiving node handle the error
reason: Option<Error>,
/// Message that triggered this error
source_message: Option<ProcessMsg>,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl MessageType {
WireMsg::new_ping_msg(dest_info.dest, dest_info.dest_section_pk).serialize()
}
Self::SectionInfo { msg, dest_info } => {
WireMsg::serialize_sectioninfo_msg(msg, dest_info.dest, dest_info.dest_section_pk)
WireMsg::serialize_section_info_msg(msg, dest_info.dest, dest_info.dest_section_pk)
}
Self::Client { msg, dest_info } => {
WireMsg::serialize_client_msg(msg, dest_info.dest, dest_info.dest_section_pk)
Expand Down
2 changes: 1 addition & 1 deletion src/section_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ impl Message {

/// serialize this Query into bytes ready to be sent over the wire.
pub fn serialize(&self, dest: XorName, dest_section_pk: BlsPublicKey) -> crate::Result<Bytes> {
WireMsg::serialize_sectioninfo_msg(self, dest, dest_section_pk)
WireMsg::serialize_section_info_msg(self, dest, dest_section_pk)
}
}
10 changes: 5 additions & 5 deletions src/serialisation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl WireMsg {
}

/// Creates a new instance keeping a (serialized) copy of the 'SectionInfo' message provided.
pub fn new_sectioninfo_msg(
pub fn new_section_info_msg(
query: &section_info::Message,
dest: XorName,
dest_section_pk: PublicKey,
Expand Down Expand Up @@ -238,12 +238,12 @@ impl WireMsg {

/// Convenience function which creates a temporary WireMsg from the provided
/// MsgEnvelope, returning the serialized WireMsg.
pub fn serialize_sectioninfo_msg(
pub fn serialize_section_info_msg(
query: &section_info::Message,
dest: XorName,
dest_section_pk: PublicKey,
) -> Result<Bytes> {
Self::new_sectioninfo_msg(query, dest, dest_section_pk)?.serialize()
Self::new_section_info_msg(query, dest, dest_section_pk)?.serialize()
}

/// Convenience function which creates a temporary WireMsg from the provided
Expand Down Expand Up @@ -320,12 +320,12 @@ mod tests {
}

#[test]
fn serialisation_sectioninfo_msg() -> Result<()> {
fn serialisation_section_info_msg() -> Result<()> {
let dest = XorName::random();
let dest_section_pk = SecretKey::random().public_key();

let query = section_info::Message::GetSectionQuery(dest_section_pk.into());
let wire_msg = WireMsg::new_sectioninfo_msg(&query, dest, dest_section_pk)?;
let wire_msg = WireMsg::new_section_info_msg(&query, dest, dest_section_pk)?;
let serialized = wire_msg.serialize()?;

// test deserialisation of header
Expand Down

0 comments on commit d2b860e

Please sign in to comment.