Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanKung committed Jul 6, 2023
1 parent 0a3fbfd commit 05bc875
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions core/src/message/handlers/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::message::MessagePayload;
pub async fn handle_join_dht(act: PeerRingAction) -> Result<Vec<MessageHandlerEvent>> {
match act {
PeerRingAction::None => Ok(vec![]),
// Ask next fo find successor for did,
// Ask next hop to find successor for did,
// if there is only two nodes A, B, it may cause loop, for example
// A's successor is B, B ask A to find successor for B
// A may send message to it's successor, which is B
Expand Down Expand Up @@ -76,7 +76,7 @@ pub async fn handle_join_dht(act: PeerRingAction) -> Result<Vec<MessageHandlerEv
}
}

/// When handling update successor, it may cause two situtation, and it may cause multiple situtation.
/// When handling update successor, it may cause two situtation, and it may cause multiple situation.
/// 1. DHT put a connected successor into successor list, and ask successor_list of it.
/// 2. DHT wana set a new successor into successor list, but it's not connected, thus it request to connect first.
#[cfg_attr(feature = "wasm", async_recursion(?Send))]
Expand Down
12 changes: 6 additions & 6 deletions core/src/message/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub struct FindSuccessorSend {
/// did of target
pub did: Did,
/// if strict is true, it will try to find the exactly did,
/// eles it will try to find the closest did.
/// else it will try to find the closest did.
pub strict: bool,
/// events should be triggerd after found successor
/// events should be triggered after found successor
pub then: FindSuccessorThen,
}

Expand All @@ -50,7 +50,7 @@ pub struct FindSuccessorReport {
pub did: Did,
/// handler event after processed `then` of FindSuccessorSend.
/// Usually it will contains `then` from FindSuccessorSend,
/// And when sender recieved report, it should call related handler for the event
/// And when sender received report, it should call related handler for the event
pub handler: FindSuccessorReportHandler,
}

Expand Down Expand Up @@ -99,14 +99,14 @@ pub struct LeaveDHT {
/// MessageType use to search virtual node.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct SearchVNode {
/// The virtual id of seraching target
/// The virtual id of searching target
pub vid: Did,
}

/// MessageType report to origin found virtual node.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct FoundVNode {
/// Resposne of [SearchVNode], containing response data
/// Response of [SearchVNode], containing response data
pub data: Vec<VirtualNode>,
}

Expand Down Expand Up @@ -161,7 +161,7 @@ pub enum Message {
FindSuccessorSend(FindSuccessorSend),
/// Response of FindSuccessorSend
FindSuccessorReport(FindSuccessorReport),
/// Remote message of notify a precessor
/// Remote message of notify a predecessor
NotifyPredecessorSend(NotifyPredecessorSend),
/// Response of NotifyPredecessorSend
NotifyPredecessorReport(NotifyPredecessorReport),
Expand Down
2 changes: 0 additions & 2 deletions core/src/swarm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ impl Swarm {
}

/// Event handler of Swarm.
#[cfg_attr(feature = "wasm", async_recursion(?Send))]
#[cfg_attr(not(feature = "wasm"), async_recursion)]
pub async fn handle_message_handler_event(
&self,
event: &MessageHandlerEvent,
Expand Down

0 comments on commit 05bc875

Please sign in to comment.