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

Commit

Permalink
Merge 02586dc into d59f298
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel-faber committed Jun 4, 2021
2 parents d59f298 + 02586dc commit 07a6d31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/section_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use xor_name::{Prefix, XorName};
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
pub enum Message {
/// Message to request information about the section that matches the given name.
GetSectionQuery(PublicKey),
GetSectionQuery {
public_key: PublicKey,
is_node: bool,
},
/// Response to `GetSectionQuery`.
GetSectionResponse(GetSectionResponse),
/// Updated info related to section
Expand Down Expand Up @@ -70,6 +73,8 @@ pub enum GetSectionResponse {
/// Successful response to `GetSectionQuery`. Contains information about the requested
/// section.
Success(SectionInfo),
/// The requesting node is not externally reachable
NodeNotReachable,
/// Response to `GetSectionQuery` containing addresses of nodes that are closer to the
/// requested name than the recipient. The request should be repeated to these addresses.
Redirect(Vec<(XorName, SocketAddr)>),
Expand Down
10 changes: 8 additions & 2 deletions src/serialisation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ mod tests {
let dest = XorName::random();
let dest_section_pk = SecretKey::random().public_key();

let query = section_info::Message::GetSectionQuery(dest_section_pk.into());
let query = section_info::Message::GetSectionQuery {
public_key: dest_section_pk.into(),
is_node: true,
};
let wire_msg = WireMsg::new_section_info_msg(&query, dest, dest_section_pk)?;
let serialized = wire_msg.serialize()?;

Expand Down Expand Up @@ -348,7 +351,10 @@ mod tests {
let dest = XorName::random();
let dest_section_pk = SecretKey::random().public_key();

let query = section_info::Message::GetSectionQuery(dest_section_pk.into());
let query = section_info::Message::GetSectionQuery {
public_key: dest_section_pk.into(),
is_node: true,
};
let mut wire_msg = WireMsg::new_section_info_msg(&query, dest, dest_section_pk)?;
let serialized = wire_msg.serialize()?;

Expand Down

0 comments on commit 07a6d31

Please sign in to comment.